Closed
Description
SO ...
opaque type T = String
object T {
def unwrap(t: T): String = t
}
opaque type U = String
type W = U
object U {
def unwrap(w: W): String = w
}
The unwrap
in T works fine, as advertised. However, unwrap
for U fails because it's defined in terms of the type alias W
for U
.
error] | def unwrap(w: W): String = w
[error] | ^
[error] | Found: W(w)
[error] | Required: String
I would expect W to de-alias to V, and then work.
Metadata
Metadata
Assignees
Labels
No labels