Closed
Description
This code snippet does not compile with Dotty:
class Test {
class Foo {
def bar(x: String): Int = 1
}
implicit class FooOps(foo: Foo) {
def bar(x: Int, y: Int = 2): Int = 2 // compiles with no default argument
}
def test(foo: Foo): Unit = {
foo.bar(1)
}
}
[info] Running dotty.tools.dotc.Main -d out Test.scala -classpath dotty-library_2.12-0.5.0-bin-SNAPSHOT-nonbootstrapped.jar
-- [E007] Type Mismatch Error: tests/allan/Test.scala:23:12 --------------------
23 | foo.bar(1)
| ^
| found: Int(1)
| required: String
|
Maybe related to #3168