Eric Milles created GROOVY-10354:
------------------------------------

             Summary: STC: wrong closure parameter type(s) inferred for 
SAM-type assignment
                 Key: GROOVY-10354
                 URL: https://issues.apache.org/jira/browse/GROOVY-10354
             Project: Groovy
          Issue Type: Bug
            Reporter: Eric Milles


Follow up from GROOVY-9998.  Consider the following:
{code:groovy}
@groovy.transform.TypeChecked
void test() {
  Comparator<? super String> comparator = { o1, o2 ->
    o1.toLowerCase() <=> o2.toLowerCase()
  }
}
{code}

No STC error is produced for "o1.toLowerCase()", which cannot be safely assumed 
is of type String.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to