Skip to content

Commit 9c16e7a

Browse files
authored
Merge pull request #9215 from dotty-staging/fix-#9202
Fix #9202: Use correct context in integrateOpaqueMembers
2 parents f24fd9f + 3e714da commit 9c16e7a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4418,7 +4418,7 @@ object Types {
44184418
decls.toList.foldLeft(this) { (cinfo, sym) =>
44194419
if sym.isOpaqueAlias then
44204420
cls.setFlag(Opaque)
4421-
def force =
4421+
def force(using Context) =
44224422
if sym.isOpaqueAlias then // could have been reset because of a syntax error
44234423
sym.infoOrCompleter match
44244424
case completer: LazyType =>
@@ -4429,7 +4429,7 @@ object Types {
44294429
else defn.AnyType // dummy type in case of errors
44304430
def refineSelfType(selfType: Type) =
44314431
RefinedType(selfType, sym.name,
4432-
TypeAlias(LazyRef(_ => force, reportCycles = true)))
4432+
TypeAlias(LazyRef(force(using _), reportCycles = true)))
44334433
cinfo.selfInfo match
44344434
case self: Type =>
44354435
cinfo.derivedClassInfo(

tests/pos/i9202.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object i9202 {
2+
opaque type SomeUnrelatedOpaque = Int
3+
class A[T](val d: T)
4+
extension Ex2SameNameToBeToImport on [T] (x: A[T]) { def value: T = x.d }
5+
}

0 commit comments

Comments
 (0)