diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index 243d4026725a..c65cea89202f 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -752,7 +752,7 @@ object Denotations { /** The TypeRef representing this type denotation at its original location. */ def typeRef(implicit ctx: Context): TypeRef = - TypeRef(symbol.owner.thisType, symbol.name.asTypeName, this) + TypeRef(symbol.owner.thisType, symbol).withDenot(this) /** The typeRef applied to its own type parameters */ def appliedRef(implicit ctx: Context): Type = @@ -760,7 +760,7 @@ object Denotations { /** The TermRef representing this term denotation at its original location. */ def termRef(implicit ctx: Context): TermRef = - TermRef(symbol.owner.thisType, symbol.name.asTermName, this) + TermRef(symbol.owner.thisType, symbol).withDenot(this) /** The NamedType representing this denotation at its original location. * Same as either `typeRef` or `termRef` depending whether this denotes a type or not.