Dotty should harder to unify subtypes of sealed traits #22478
xiaoshihou514
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following:
Ouput:
This should have compiled since Expr is sealed and every possible branch fulfilled the requirements (returned the same most specific type
IntLiteral
).This means that I cannot pass a
Foo & Bar
into such a type-preserving function (A => A
whereA <: Foo
) and expect the result to unify withBar
.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions