@@ -2358,6 +2358,9 @@ public void erasedGenericPrimitiveDefaultsPropagateThroughCompositeContexts() th
23582358 " let indexed = values[useBox ? box.get() : 0]" ,
23592359 " IntSupplier supplier = () -> (useBox ? box.get() : 0)" ,
23602360 " IntSupplier unarySupplier = () -> -box.get()" ,
2361+ " IntSupplier blockSupplier = () -> begin" ,
2362+ " return (useBox ? box.get() : 0)" ,
2363+ " end" ,
23612364 " let constructed = new Constructed(useBox ? box.get() : 0)" ,
23622365 " int blockValue = begin" ,
23632366 " return (useBox ? box.get() : 0)" ,
@@ -2368,12 +2371,12 @@ public void erasedGenericPrimitiveDefaultsPropagateThroughCompositeContexts() th
23682371 " switchValue = 0" ,
23692372 " if sum == 0 and builtinSum == 0 and overloaded == 0 and blockOverloaded == 0" ,
23702373 " and indexed == 7 and readArrayValue() == 7 and supplier.get() == 0" ,
2371- " and unarySupplier.get() == 0" ,
2374+ " and unarySupplier.get() == 0 and blockSupplier.get() == 0 " ,
23722375 " and blockValue == 0 and switchValue == 0 and constructed.get() == 0" ,
23732376 " testSuccess()"
23742377 );
23752378 String compiled = compiledLua ("erasedGenericPrimitiveDefaultsPropagateThroughCompositeContexts" );
2376- assertEquals ("each concrete integer consumer must normalize its erased generic input" , 11 ,
2379+ assertEquals ("each concrete integer consumer must normalize its erased generic input" , 12 ,
23772380 countOccurrences (compiled , "__wurst_ensureInt(Box_Box_get(" ));
23782381 assertTrue ("global primitive array reads must remain safe for foreign writes" ,
23792382 compiled .contains ("__wurst_ensureInt(Test_values[0])" ));
0 commit comments