Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.7, 2.4.8
-
None
Description
Given the following snippet
import groovy.transform.CompileStatic @CompileStatic class Foo { void isEqualTo(Number number) { println "Number" } void isEqualTo(Object number) { println "Object" } } @CompileStatic class Runner { void run() { new Foo().isEqualTo(4) } } new Runner().run()
When you try to run it
Then you get the following exception
[Static type checking] - Reference to method is ambiguous. Cannot choose between [void Foo#isEqualTo(java.lang.Object), void Foo#isEqualTo(java.lang.Number)] at line: 13, column: 1
And you would expect the thing to compile properly