Skip to content

Commit 92aa2e5

Browse files
oderskyWojciechMazur
authored andcommitted
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. [Cherry-picked 413c667]
1 parent d2f07d9 commit 92aa2e5

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
@@ -107,7 +107,7 @@ extension (tp: Type)
107107
case tp @ CapturingType(parent, refs) =>
108108
val pcs = getBoxed(parent)
109109
if tp.isBoxed then refs ++ pcs else pcs
110-
case tp: TypeRef if tp.symbol.isAbstractType => CaptureSet.empty
110+
case tp: TypeRef if tp.symbol.isAbstractOrParamType => CaptureSet.empty
111111
case tp: TypeProxy => getBoxed(tp.superType)
112112
case tp: AndType => getBoxed(tp.tp1) ** getBoxed(tp.tp2)
113113
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
@@ -657,7 +657,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
657657

658658
def canManifest(tp: Manifestable, topLevel: Boolean) =
659659
val sym = tp.typeSymbol
660-
!sym.isAbstractType
660+
!sym.isAbstractOrParamType
661661
&& hasStableErasure(tp)
662662
&& !(topLevel && defn.isBottomClassAfterErasure(sym))
663663

0 commit comments

Comments
 (0)