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 2022/11/04 15:59:00 UTC

[jira] [Created] (GROOVY-10812) Expect parse error for angle brackets on left side of dot in method call

Eric Milles created GROOVY-10812:
------------------------------------

             Summary: Expect parse error for angle brackets on left side of dot in method call
                 Key: GROOVY-10812
                 URL: https://issues.apache.org/jira/browse/GROOVY-10812
             Project: Groovy
          Issue Type: Bug
          Components: parser-antlr4
            Reporter: Eric Milles


Static method call like "Comparator<String>.comparing(Foo::bar);" or "java.util.Comparator<String>.comparing(Foo::bar);" should result in parse error.

I think the intent was to supply type arguments for the method, but those go on the other side of the dot, like this: "Comparator.<String,String>comparing(Foo::bar);"

The same applies to a property expression like "Comparator<String>.FOO".  The only circumstance that I can think of to support this kind of thing is a constructor expression: "new Foo<X>.Bar<Y>()".  I can't remember if this is even supported by groovy yet.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)