groovy
  1. groovy
  2. GROOVY-5415

Static Type checker reporting invalid error

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-3
    • Fix Version/s: 2.0-beta-3
    • Component/s: Static Type Checker
    • Labels:
      None
    • Environment:
      java 7, groovy 2.0-beta-3-snapshot
    • Number of attachments :
      0

      Description

      ClassA.java
      
      public class ClassA<T> {
          <X> Class<X> foo(Class<X> classType){
              return classType;
          }
      }
      
      ClassB.groovy
      
      import groovy.transform.CompileStatic
      
      @CompileStatic
      class ClassB {
          void bar() {
              def ClassA<Long> a = new ClassA<Long>();
              a.foo(this.getClass());
          }
      }
      

      ClassB.groovy: 13: [Static type checking] - Cannot find matching method ClassA#foo(java.lang.Class <java.lang.Object extends java.lang.Object>)
      @ line 13, column 9.
      a.foo(this.getClass());
      ^

        Activity

        Show
        CÚdric Champeau added a comment - Fixed by https://github.com/groovy/groovy-core/commit/57f81009f037eb3c50376da760f4ee43662f6ef4

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            Murali Mohan Rath
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: