Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7922

Static type checking not strict enough in the presence of ambiguous method matching

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.8
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      This example:

      import groovy.transform.CompileStatic
      
      interface FooA {}
      interface FooB {}
      class FooAB implements FooA, FooB {}
      @CompileStatic
      class TestGroovy {
          static void test() { println new TestGroovy().foo(new FooAB()) }
          def foo(FooB x) { 43 }
          def foo(FooA x) { 42 }
      }
      
      TestGroovy.test()
      

      Should probably throw some kind of ambiguous method error during compilation to match Java (and dynamic Groovy's runtime error).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jwagenleitner John Wagenleitner
                Reporter:
                paulk Paul King
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: