-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Typer fixes #5017
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
Typer fixes #5017
Conversation
Check if we inherit from scala.Enum both directly (as a result of the desugaring) and indirectly.
To allow again t3613 to compile I need this exception. But the testcase is so old I'm not sure if we should do this, even tho it's still supported by Scalac.
@@ -1529,6 +1529,7 @@ class Typer extends Namer | |||
ctx.error(i"$psym is extended twice", tree.pos) | |||
seenParents += psym | |||
if (tree.isType) { | |||
checkSimpleKinded(result) // Not needed for constructor calls, as type arguments will be inferred. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will they be inferred? I'm unconvinced that
class Siz[T](i: Int)
class Zle extends Siz(1)
and
class Siz[T]
class Zle extends Siz
should be treated differently w/r/t superclass targs.
(Since GitHub hides @hrhino's comment):
Well If we want uniformity, we could also infer arguments to all parents, but that seems more error-prone, no? EDIT: a better argument for the difference is that inference |
This reverts commit 1fe1232 as it was an incorrect diagnosis. The only existing testcase was written when AbstractListModel had no parameter, so change the testcase instead. We could alternatively infer type arguments (see scala/bug#11111), but that seems typically unhelpful.
Based on scala/scala@bed3304bf86 and Nicolas' suggestion.
@Blaisorblade Can you split the fix for enum into another PR? |
So the failure in http://dotty-ci.epfl.ch/lampepfl/dotty/7075/5 is because master is still broken by the Java 9 PR. |
But this isn't a full fix and might be a bad idea.
Give ``` trait Foo scala> val v = Foo 1 |val v = Foo | ^^^ | not found: Foo ``` which is misleading because `Foo` exists, just as a type and not as a value (we should maybe say "term" but Scala 2 uses "value").
`-Ycheck:all` is already handled by `containsPhase`.
WIP fixing #5008 and #5010.