Skip to content

Commit a210cb8

Browse files
committed
Standardize on followAliases = true
1 parent d012214 commit a210cb8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ object ccConfig:
5555
def useFresh(using Context): Boolean =
5656
Feature.sourceVersion.stable.isAtLeast(SourceVersion.`3.6`)
5757

58-
def followAliases(using Context): Boolean =
59-
Feature.sourceVersion.stable.isAtLeast(SourceVersion.`3.6`)
6058
end ccConfig
6159

6260
/** Are we at checkCaptures phase? */

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
278278
paramInfos = tp.paramInfos.mapConserve(_.dropAllRetains.bounds),
279279
resType = this(tp.resType))
280280
case _ =>
281-
if ccConfig.followAliases then mapFollowingAliases(tp) else mapOver(tp)
281+
mapFollowingAliases(tp)
282282
addVar(addCaptureRefinements(normalizeCaptures(tp1)), ctx.owner)
283283
end apply
284284
end mapInferred
@@ -366,8 +366,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
366366
// Map references to capability classes C to C^
367367
if t.derivesFromCapability && !t.isSingleton && t.typeSymbol != defn.Caps_Exists
368368
then CapturingType(t, defn.universalCSImpliedByCapability, boxed = false)
369-
else normalizeCaptures(
370-
if ccConfig.followAliases then mapFollowingAliases(t) else mapOver(t))
369+
else normalizeCaptures(mapFollowingAliases(t))
371370
end toCapturing
372371

373372
def fail(msg: Message) =
@@ -857,8 +856,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
857856
case tp @ OrType(tp1, tp2 @ CapturingType(parent2, refs2)) =>
858857
CapturingType(OrType(tp1, parent2, tp.isSoft), refs2, tp2.isBoxed)
859858
case tp @ AppliedType(tycon, args)
860-
if !defn.isFunctionClass(tp.dealias.typeSymbol)
861-
&& (!ccConfig.followAliases || (tp.dealias eq tp)) =>
859+
if !defn.isFunctionClass(tp.dealias.typeSymbol) && (tp.dealias eq tp) =>
862860
tp.derivedAppliedType(tycon, args.mapConserve(box))
863861
case tp: RealTypeBounds =>
864862
tp.derivedTypeBounds(tp.lo, box(tp.hi))

0 commit comments

Comments
 (0)