Skip to content

Commit 45febea

Browse files
committed
The qual of This could be Ident
We should check the type instead, which is more semantic.
1 parent 7bad5b1 commit 45febea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class TreeChecker extends Phase with SymTransformer {
414414
}
415415

416416
override def typedSuper(tree: untpd.Super, pt: Type)(using Context): Tree =
417-
assert(tree.qual.isInstanceOf[untpd.This], i"expect prefix of Super to be This, actual = ${tree.qual}")
417+
assert(tree.qual.tpe.isInstanceOf[ThisType], i"expect prefix of Super to be This, actual = ${tree.qual}")
418418
super.typedSuper(tree, pt)
419419

420420
private def checkOwner(tree: untpd.Tree)(using Context): Unit = {

0 commit comments

Comments
 (0)