[jira] [Commented] (GROOVY-8509) SC: error for call to protected method from same package

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (GROOVY-8509) SC: error for call to protected method from same package

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/GROOVY-8509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477881#comment-16477881 ]

John Wagenleitner commented on GROOVY-8509:
-------------------------------------------

Thanks for the suggested patch.
{quote}Why does @TypeChecked not support these warnings? Are calls to private, package-private and protected methods supported for @TypeChecked code?
{quote}
I believe this is because {{@TypeChecked}} performs runtime dispatch so behaves similar to dynamic mode when it comes to being able to access methods that wouldn't be accessible in static mode. It looks like GROOVY-7883 changed this (not sure if intentional or not) so this may no longer be the case from 2.5.0 on.

> SC: error for call to protected method from same package
> --------------------------------------------------------
>
>                 Key: GROOVY-8509
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8509
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.0-beta-2, 2.6.0-alpha-3
>            Reporter: Eric Milles
>            Priority: Major
>
> Groovy 2.5+ is producing compilation errors for @CompileStatic test class calling a protected method of class under test (in same package).  This should be allowed as protected is "package-private" plus subtypes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)