Christopher Smith created GROOVY-10768:
------------------------------------------

             Summary: Macro class should be able to resolve macro-method 
arguments
                 Key: GROOVY-10768
                 URL: https://issues.apache.org/jira/browse/GROOVY-10768
             Project: Groovy
          Issue Type: Improvement
    Affects Versions: 4.0.5
            Reporter: Christopher Smith


I'm using {{MacroClass}} to create some boilerplate methods to attach to an 
annotated class. My no-arg methods are working perfectly, but I'm having 
trouble with a static builder method:
{code:java}
var jat = constX(jsonApiType)


... in MacroClass ...
public static final com.example.JsonApiResourceId id(java.lang.String value) {
  return new com.example.JsonApiResourceId( $v { jat }, value)
}{code}
This produces a (static) compiler error
{code:java}
Cannot find matching method 
com.example.JsonApiResourceId#<init>(java.lang.String, java.lang.Object). 
Please check if the declared type is correct and if the method exists. {code}
Somehow the method body can't resolve the locally-declared parameter, and this 
is "local enough context" that it ought to.



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

Reply via email to