Eric Milles created GROOVY-10257:
------------------------------------

             Summary: STC: no error for incompatible method argument
                 Key: GROOVY-10257
                 URL: https://issues.apache.org/jira/browse/GROOVY-10257
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
    Affects Versions: 4.0.0-beta-1
            Reporter: Eric Milles
            Assignee: Eric Milles


Consider the following:
{code:groovy}
class C<T> {
  void accept(T t) {
  }
  def <X extends Number> X produce() {
  }
  @groovy.transform.TypeChecked
  void test() {
    accept(produce()) // not compatible
  }
}
{code}

Java compiler says "Cannot convert from Number to T".  Groovy compiler produces 
no error.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to