Skip to content

Commit d713d3d

Browse files
committed
Avoid alias opaques in two other places during Setup
1 parent 0565c78 commit d713d3d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
116116
* convert it to be boxed.
117117
*/
118118
private def box(tp: Type)(using Context): Type =
119-
def recur(tp: Type): Type = tp.dealiasKeepAnnots match
119+
def recur(tp: Type): Type = tp.dealiasKeepAnnotsAndOpaques match
120120
case tp @ CapturingType(parent, refs) =>
121121
if tp.isBoxed then tp else tp.boxed
122122
case tp @ AnnotatedType(parent, ann) =>
@@ -574,7 +574,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
574574
if sym.isClass then
575575
!sym.isPureClass && sym != defn.AnyClass
576576
else
577-
val tp1 = tp.dealiasKeepAnnots
577+
val tp1 = tp.dealiasKeepAnnotsAndOpaques
578578
if tp1 ne tp then needsVariable(tp1)
579579
else instanceCanBeImpure(tp1)
580580
case tp: (RefinedOrRecType | MatchType) =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ object Types {
14891489
* But if we want to see the type from the outside of object IArray we need to
14901490
* suppress this dealiasing. A test case where this matters is i18909.scala.
14911491
* Here, we dealias symbol infos at the start of capture checking in operation `fluidify`.
1492-
* We have to be careful not to accidentally reveal opqaue aliases when doing so.
1492+
* We have to be careful not to accidentally reveal opaque aliases when doing so.
14931493
*/
14941494
final def dealiasKeepOpaques(using Context): Type = dealias1(keepNever, keepOpaques = true)
14951495

0 commit comments

Comments
 (0)