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
This is working as specified, though not quite as desired.
Note that Bar and Baz have two immediate supertypes Sealed and SomeInterface, and there is no way a general upper bound algorithm could choose one over the other. So the algorithm proceeds to take the next shared supertype which is Object.
Hence, the resulting upper bound of the types Bar and Baz is Object, and it remains Object when we take the upper bound of that and Foo.
In contrast, Sealed is a shared upper bound of Foo and Baz (and SomeInterface is not, so there's no ambiguity here, and no need to go to Object), and the upper bound remains Sealed when we proceed with Bar.
Note that this proposal is currently being implemented (and it's very likely to be accepted into the language), and it would resolve this issue by allowing the context type to help choosing a useful upper bound.
I'll close the issue because it doesn't report new issues. Discussions about possible remedies can be taken in issues on the language repository.
General info
Reproduction Steps:
examples:
The text was updated successfully, but these errors were encountered: