@@ -1448,11 +1448,21 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1448
1448
private predicate compatibleContainer0 ( ApHeadContent apc , DataFlowType containerType ) {
1449
1449
exists ( DataFlowType containerType0 , Content c |
1450
1450
PrevStage:: storeStepCand ( _, _, c , _, _, containerType0 ) and
1451
+ not isTopType ( containerType0 ) and
1451
1452
compatibleTypesCached ( containerType0 , containerType ) and
1452
1453
apc = projectToHeadContent ( c )
1453
1454
)
1454
1455
}
1455
1456
1457
+ pragma [ nomagic]
1458
+ private predicate topTypeContent ( ApHeadContent apc ) {
1459
+ exists ( DataFlowType containerType0 , Content c |
1460
+ PrevStage:: storeStepCand ( _, _, c , _, _, containerType0 ) and
1461
+ isTopType ( containerType0 ) and
1462
+ apc = projectToHeadContent ( c )
1463
+ )
1464
+ }
1465
+
1456
1466
bindingset [ apc, containerType]
1457
1467
pragma [ inline_late]
1458
1468
private predicate compatibleContainer ( ApHeadContent apc , DataFlowType containerType ) {
@@ -1484,7 +1494,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
1484
1494
(
1485
1495
if castingNodeEx ( node )
1486
1496
then
1487
- ap instanceof ApNil or compatibleContainer ( getHeadContent ( ap ) , node .getDataFlowType ( ) )
1497
+ ap instanceof ApNil or
1498
+ compatibleContainer ( getHeadContent ( ap ) , node .getDataFlowType ( ) ) or
1499
+ topTypeContent ( getHeadContent ( ap ) )
1488
1500
else any ( )
1489
1501
)
1490
1502
}
0 commit comments