Skip to content

Fix #5007 (aka scala/bug#5063) #5029

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ trait Implicits { self: Typer =>
|| (from.tpe isRef defn.NothingClass)
|| (from.tpe isRef defn.NullClass)
|| !(ctx.mode is Mode.ImplicitsEnabled)
|| from.isInstanceOf[Super]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is pretty cheap compared to the other ones. I'm wondering if it is better moved earlier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't wonder about that... Super is also pretty rare so I'm not sure, but scala/scala@bed3304bf86 still puts it early.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry — I meant to agree on your suggestion but I'm away. I can review your PR for this change.

|| (from.tpe eq NoPrefix)) NoMatchingImplicitsFailure
else {
def adjust(to: Type) = to.stripTypeVar.widenExpr match {
Expand Down
3 changes: 3 additions & 0 deletions tests/neg/t5063.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {
super.+("") // error
}
4 changes: 0 additions & 4 deletions tests/untried/neg/t5063.check

This file was deleted.

3 changes: 0 additions & 3 deletions tests/untried/neg/t5063.scala

This file was deleted.