-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label
Description
Compiler version
Minimized code
trait Foo[T]
def foo[A]: Int = ???
def foo[A: Foo]: Int = ???
extension (x: Int)
def succ: Int = x + 1
val a = foo[Int]
val b = foo[Int].succ // error
Output
-- [E134] Type Error: test.scala:10:8 ------------------------------------------
10 |val b = foo[Int].succ
| ^^^
| None of the overloaded alternatives of method foo with types
| [A](using evidence$1: Foo[A]): Int
| [A]: Int
| match type arguments [Int] and expected type ?{ succ: ? }
1 error found
Expectation
Should work
Notes
I know this will be very very tricky to fix. This fails as overload resolution tries to find an alternative using the expected type (a return type that includes def/val succ
, which Int
doesn't have) for b.
Metadata
Metadata
Assignees
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label