Skip to content

Commit

Permalink
Fix scala#3775: Fix RefChecks#upwardsThisType
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smarter committed Jan 8, 2018
1 parent aa6459e commit 04ece0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/RefChecks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object RefChecks {
*/
private def upwardsThisType(cls: Symbol)(implicit ctx: Context) = cls.info match {
case ClassInfo(_, _, _, _, tp: Type) if (tp ne cls.typeRef) && !cls.is(ModuleOrFinal) =>
SkolemType(cls.typeRef).withName(nme.this_)
SkolemType(cls.appliedRef).withName(nme.this_)
case _ =>
cls.thisType
}
Expand Down

0 comments on commit 04ece0c

Please sign in to comment.