-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible regression in typer in 2.13.10 (only with Xsource:3) #12671
Comments
The instance
and by Scala 3 as
Workaround is explicit
|
But the code compiles in Scala 3? (3.2.1-RC4, 3.2.0, currently nightly) |
Dotty uses all the overrides:
though there is a shadow of a doubt
so it uses the intersection of both inherited empties
because
|
Yes, compiles fine under 3.2.0 and 3.2.1-RC2 (tested with Scastie) and from dotty/main. |
I think it's almost certainly scala/scala#9891. Apparently, we are that one person in a billion. |
Just to summarize my understanding:
Does that sound right? |
@adampauls yes, that sounds about right. It's a lot of words. The difference between Scala 2 and 3 is that Scala 2 ( I think this example shows that the Scala 3 approach is useful. I'll attempt to replicate it. I also noticed that the base class order seems inverted: Defaults should not be last, but first or second, since anything more specific should override the "default". That would also solve this issue. |
Compiler version
2.13.10 (with
-Xsource:3
).Tested with Scastie using options:
Minimized code
Output
Expectation
This compiles without
-Xsource:3
and it compiled under 2.13.8 with-Xsource:3
. It will also compile fineoverride def empty = FooTrie.empty[T]
is changed tooverride def empty: FooTrie[T] = FooTrie.empty[T]
scala/scala#10160 seems like a possible candidate based on the fact that it is specific to
-Xsource:3
.The text was updated successfully, but these errors were encountered: