You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectTest:traitFoo:valx:Any???matchcasef: Foo=>
(f: Foo).x // ok
f.x // error
Output
-- [E007] TypeMismatchError: tests/playground/example.scala:11:6-------------11| f.x // error|^|Found: (f : Nothing)
|Required:?{ x: ? }
|Note that implicit conversions were not tried because the result of an implicit conversion
|must be more specific than ?{ x: <?> }
Expectation
no error
The text was updated successfully, but these errors were encountered:
It's because ??? has type Nothing, so the pattern has type Nothing as well. We use what we know from the scrutinee and from the pattern to type the pattern, so this looks as expected.
Compiler version
3.5.1-RC1-bin-SNAPSHOT-nonbootstrapped-git-cd8c5ed
Minimized code
Minimized from i7294.scala with @hamzaremmal
Output
Expectation
no error
The text was updated successfully, but these errors were encountered: