You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2018/03/15 17:50:00 UTC

[jira] [Commented] (GROOVY-8511) @PackageScope(METHODS) fails under Parrot Parser due to synthetic public determination

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

Eric Milles commented on GROOVY-8511:
-------------------------------------

It is not a problem for the scenario you tested.  However there are other ways to use @PackageScope.  You can annotate the class and indicate that fields and/or methods should be package-private.

Also, I don't agree with your general determination of synthetic public.  If there is not "private", "public" or "protected" explicitly, you go into a series of checks for annotation and whatnot.  Isn't a class, field, method or property synthetic public when it lacks one of the three visibility modifiers?  Not setting that metadata correctly can have many unforseen downstream consequences, like the one in the PackageScope transform.

> @PackageScope(METHODS) fails under Parrot Parser due to synthetic public determination
> --------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8511
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8511
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.6.0-alpha-3
>            Reporter: Eric Milles
>            Assignee: Daniel Sun
>            Priority: Major
>
> The new Parrot Parser does not set the synthetic public flag quite the same as before for methods.  This affects {{@PackageScope(PackageScopeTarget.METHODS)}} specifically because it checks that a method is synthetic public before altering the method's modifiers.
> You can compare how this flag is set for methods in {{AntlrParserPlugin.methodDef}} and {{AstBuilder.visitMethodDeclaration(MethodDeclarationContext)}}.



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