Skip to content

Commit 85fbfb6

Browse files
committed
do not dealias FromJavaObject during box adaptation
1 parent f1977ed commit 85fbfb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,8 @@ class CheckCaptures extends Recheck, SymTransformer:
736736
else
737737
((parent, cs, tp.isBoxed), reconstruct)
738738
case actual =>
739-
((actual, CaptureSet(), false), reconstruct)
739+
val res = if tp.isFromJavaObject then tp else actual
740+
((res, CaptureSet(), false), reconstruct)
740741

741742
def adapt(actual: Type, expected: Type, covariant: Boolean): Type = trace(adaptInfo(actual, expected, covariant), recheckr, show = true) {
742743
if expected.isInstanceOf[WildcardType] then actual

0 commit comments

Comments
 (0)