Skip to content

Commit a8eb777

Browse files
committed
Call normalizeOpaque in window of vulnerability
It turns out we get confused when we call normalizeOpaque as part of normal completion during computeDenot. Calling normalizeOpaque in the window of vulnerability defined where a type is Opaque but not yet Deferred fixes the problem. Before the following tests failed when compiled from-tasty: tests/run/implicit-specifity.scala failed tests/pos/i5720.scala failed tests/pos/toplevel-opaque-xm failed
1 parent 73e6bf2 commit a8eb777

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,10 @@ object Types {
18831883
finish(memberDenot(symd.initial.name, allowPrivate = false))
18841884
else if (prefix.isArgPrefixOf(symd))
18851885
finish(argDenot(sym.asType))
1886-
else if (infoDependsOnPrefix(symd, prefix))
1886+
else if (infoDependsOnPrefix(symd, prefix)) {
1887+
if (!symd.isClass && symd.is(Opaque, butNot = Deferred)) symd.normalizeOpaque()
18871888
finish(memberDenot(symd.initial.name, allowPrivate = symd.is(Private)))
1889+
}
18881890
else
18891891
finish(symd.current)
18901892
}

0 commit comments

Comments
 (0)