Skip to content

Commit 413c667

Browse files
committed
Use isAbstractOrParamType more
There were some other occurrences of isAbstractType where it was not clear why type parameters should be excluded. Use isAbstractOrParamType as the new default.
1 parent 7e1c4ca commit 413c667

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ extension (tp: Type)
150150
case tp @ CapturingType(parent, refs) =>
151151
val pcs = getBoxed(parent)
152152
if tp.isBoxed then refs ++ pcs else pcs
153-
case tp: TypeRef if tp.symbol.isAbstractType => CaptureSet.empty
153+
case tp: TypeRef if tp.symbol.isAbstractOrParamType => CaptureSet.empty
154154
case tp: TypeProxy => getBoxed(tp.superType)
155155
case tp: AndType => getBoxed(tp.tp1) ** getBoxed(tp.tp2)
156156
case tp: OrType => getBoxed(tp.tp1) ++ getBoxed(tp.tp2)

compiler/src/dotty/tools/dotc/core/TypeErasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ object TypeErasure {
266266
tp.paramNames, tp.paramNames map (Function.const(TypeBounds.upper(defn.ObjectType))), tp.resultType)
267267

268268
if (defn.isPolymorphicAfterErasure(sym)) eraseParamBounds(sym.info.asInstanceOf[PolyType])
269-
else if (sym.isAbstractType) TypeAlias(WildcardType)
269+
else if (sym.isAbstractOrParamType) TypeAlias(WildcardType)
270270
else if sym.is(ConstructorProxy) then NoType
271271
else if (sym.isConstructor) outer.addParam(sym.owner.asClass, erase(tp)(using preErasureCtx))
272272
else if (sym.is(Label)) erase.eraseResult(sym.info)(using preErasureCtx)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ trait Deriving {
3131
/** A version of Type#underlyingClassRef that works also for higher-kinded types */
3232
private def underlyingClassRef(tp: Type): Type = tp match {
3333
case tp: TypeRef if tp.symbol.isClass => tp
34-
case tp: TypeRef if tp.symbol.isAbstractType => NoType
34+
case tp: TypeRef if tp.symbol.isAbstractOrParamType => NoType
3535
case tp: TermRef => NoType
3636
case tp: TypeProxy => underlyingClassRef(tp.superType)
3737
case _ => NoType

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
671671

672672
def canManifest(tp: Manifestable, topLevel: Boolean) =
673673
val sym = tp.typeSymbol
674-
!sym.isAbstractType
674+
!sym.isAbstractOrParamType
675675
&& hasStableErasure(tp)
676676
&& !(topLevel && defn.isBottomClassAfterErasure(sym))
677677

0 commit comments

Comments
 (0)