Skip to content

Commit 04ece0c

Browse files
committed
Fix #3775: Fix RefChecks#upwardsThisType
A non-applied class TypeRef is not a valid prefix for a TypeRef of a class type parameter, it causes an assertion error in NamedType#argDenot because args.nonEmpty ends up false.
1 parent aa6459e commit 04ece0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ object RefChecks {
8686
*/
8787
private def upwardsThisType(cls: Symbol)(implicit ctx: Context) = cls.info match {
8888
case ClassInfo(_, _, _, _, tp: Type) if (tp ne cls.typeRef) && !cls.is(ModuleOrFinal) =>
89-
SkolemType(cls.typeRef).withName(nme.this_)
89+
SkolemType(cls.appliedRef).withName(nme.this_)
9090
case _ =>
9191
cls.thisType
9292
}

0 commit comments

Comments
 (0)