Closed
Description
Compiler version
3.2.0
Minimized code
trait Env {
type Res
}
type EnvFunc = (env: Env) ?=> env.Res
val func1: (env: Env) ?=> env.Res = ???
val func2: EnvFunc = ???
def consume(f: EnvFunc): Unit = ???
object Main {
consume(func1) // ok
consume(func2) // error
}
Output
[error] 33 | consume(func2) // error
[error] | ^^^^^
[error] | Found: examples.Env#Res
[error] | Required: evidence$2.Res
Expectation
Both functions should type check, as I expect type alias usages to be always interchangeable with their definition.