diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index feb6bc391a55..546cce74aaf7 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -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] || (from.tpe eq NoPrefix)) NoMatchingImplicitsFailure else { def adjust(to: Type) = to.stripTypeVar.widenExpr match { diff --git a/tests/neg/t5063.scala b/tests/neg/t5063.scala new file mode 100644 index 000000000000..0566e90798f5 --- /dev/null +++ b/tests/neg/t5063.scala @@ -0,0 +1,3 @@ +class A { + super.+("") // error +} diff --git a/tests/untried/neg/t5063.check b/tests/untried/neg/t5063.check deleted file mode 100644 index c6e553c1b5f6..000000000000 --- a/tests/untried/neg/t5063.check +++ /dev/null @@ -1,4 +0,0 @@ -t5063.scala:2: error: value + is not a member of AnyRef - super.+("") - ^ -one error found diff --git a/tests/untried/neg/t5063.scala b/tests/untried/neg/t5063.scala deleted file mode 100644 index 5b34b53fb7fc..000000000000 --- a/tests/untried/neg/t5063.scala +++ /dev/null @@ -1,3 +0,0 @@ -class A { - super.+("") -}