diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 2fa4f94c1..ab5c795e3 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -875,13 +875,16 @@ object Types { if (tp.symbol.isClass) tp else if (tp.symbol.isAliasType) tp.underlying.underlyingClassRef(refinementOK) else NoType - case tp: AnnotatedType => tp.underlying.underlyingClassRef(refinementOK) + case tp: AnnotatedType => + tp.underlying.underlyingClassRef(refinementOK) case tp: RefinedType => def isParamName = tp.classSymbol.typeParams.exists(_.name == tp.refinedName) - if (refinementOK || isParamName) tp.underlying.underlyingClassRef(refinementOK) + if (refinementOK || tp.isTypeParam || isParamName) tp.underlying.underlyingClassRef(refinementOK) else NoType - case tp: RecType if refinementOK => tp.parent - case _ => NoType + case tp: RecType => + tp.underlying.underlyingClassRef(refinementOK) + case _ => + NoType } /** The iterator of underlying types as long as type is a TypeProxy. |