diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index ea4101558..9d692f39f 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1506,8 +1506,11 @@ object Types { override def withSym(sym: Symbol, signature: Signature)(implicit ctx: Context): ThisType = unsupported("withSym") - override def newLikeThis(prefix: Type)(implicit ctx: Context): NamedType = - NamedType.withFixedSym(prefix, fixedSym) + override def newLikeThis(prefix: Type)(implicit ctx: Context): NamedType = { + var newSym = prefix.member(fixedSym.name).symbol + if (!newSym.exists) newSym = fixedSym + NamedType.withFixedSym(prefix, newSym) + } override def equals(that: Any) = that match { case that: WithFixedSym => this.prefix == that.prefix && (this.fixedSym eq that.fixedSym) |