-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
class A
trait Foo {
def foo: implicit A => Int
}
class Test {
new FooI{}
}
class FooI extends Foo {
def foo: implicit A => Int = 3
}fails to compile:
> dotc Test.scala
-- Error: tests/allan/Test.scala:8:2 -------------------------------------------
8 | new FooI{}
| ^
|object creation impossible, since def foo$direct(implicit x$0: A): Int is not defined The issue is that at the time RefChecks transforms new FooI{}, class FooI hasn't gone through ShortcutImplicits which creates the member def foo$direct(implicit x$0: A): Int but trait Foo has