forked from JavaTX/JavaCompilerCore
Unify.subunify wildcards werden entfernt, wenn sie auf beiden Seiten identisch sind
This commit is contained in:
parent
a549843f05
commit
1b1a690212
@ -1179,6 +1179,32 @@ throws MatchException
|
|||||||
inferencelog.debug("Ausgewaehltes Paar = " + P.toString() + "");
|
inferencelog.debug("Ausgewaehltes Paar = " + P.toString() + "");
|
||||||
inferencelog.debug( "--------------------------------------------------");
|
inferencelog.debug( "--------------------------------------------------");
|
||||||
|
|
||||||
|
//wenn noetig extends-wildcards entfernen PL 15-01-30
|
||||||
|
if(P.TA1 instanceof ExtendsWildcardType && P.TA2 instanceof ExtendsWildcardType)
|
||||||
|
{
|
||||||
|
ExtendsWildcardType exT1 = (ExtendsWildcardType)P.TA1;
|
||||||
|
ExtendsWildcardType exT2 = (ExtendsWildcardType)P.TA2;
|
||||||
|
|
||||||
|
H.addElement(new Pair(exT1.get_ExtendsType(), exT2.get_ExtendsType()));
|
||||||
|
|
||||||
|
bRegel = true;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//wenn noetig super-wildcards entfernen PL 15-01-30
|
||||||
|
if(P.TA1 instanceof SuperWildcardType && P.TA2 instanceof SuperWildcardType)
|
||||||
|
{
|
||||||
|
SuperWildcardType suT1 = (SuperWildcardType)P.TA1;
|
||||||
|
SuperWildcardType suT2 = (SuperWildcardType)P.TA2;
|
||||||
|
|
||||||
|
H.addElement(new Pair(suT1.get_SuperType(), suT2.get_SuperType()));
|
||||||
|
|
||||||
|
bRegel = true;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Bei allen Erase erfolgt keine Kopie nach H, dadurch wird das Pair gelöscht.
|
// Bei allen Erase erfolgt keine Kopie nach H, dadurch wird das Pair gelöscht.
|
||||||
//ERASE3
|
//ERASE3
|
||||||
if( P.isEqual() && P.OperatorEqual() )
|
if( P.isEqual() && P.OperatorEqual() )
|
||||||
@ -1383,21 +1409,21 @@ throws MatchException
|
|||||||
TA1 = (RefType)P.TA1;
|
TA1 = (RefType)P.TA1;
|
||||||
TA2 = (RefType)P.TA2;
|
TA2 = (RefType)P.TA2;
|
||||||
}
|
}
|
||||||
else if(P.TA1 instanceof ExtendsWildcardType && P.TA2 instanceof ExtendsWildcardType)
|
else if(P.TA1 instanceof ExtendsWildcardType && P.TA2 instanceof ExtendsWildcardType) //nicht mehr noetig, wird bereits am Anfang der Schleife entfernt
|
||||||
{
|
{
|
||||||
ExtendsWildcardType exT1 = (ExtendsWildcardType)P.TA1;
|
ExtendsWildcardType exT1 = (ExtendsWildcardType)P.TA1;
|
||||||
ExtendsWildcardType exT2 = (ExtendsWildcardType)P.TA2;
|
ExtendsWildcardType exT2 = (ExtendsWildcardType)P.TA2;
|
||||||
//if(exT1.get_ExtendsType() instanceof RefType && exT2.get_ExtendsType() instanceof RefType) PL 15-01-30
|
if(exT1.get_ExtendsType() instanceof RefType && exT2.get_ExtendsType() instanceof RefType)
|
||||||
{
|
{
|
||||||
TA1 = (RefType)exT1.get_ExtendsType();
|
TA1 = (RefType)exT1.get_ExtendsType();
|
||||||
TA2 = (RefType)exT2.get_ExtendsType();
|
TA2 = (RefType)exT2.get_ExtendsType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(P.TA1 instanceof SuperWildcardType && P.TA2 instanceof SuperWildcardType)
|
else if(P.TA1 instanceof SuperWildcardType && P.TA2 instanceof SuperWildcardType) //nicht mehr noetig, wird bereits am Anfang der Schleife entfernt
|
||||||
{
|
{
|
||||||
SuperWildcardType suT1 = (SuperWildcardType)P.TA1;
|
SuperWildcardType suT1 = (SuperWildcardType)P.TA1;
|
||||||
SuperWildcardType suT2 = (SuperWildcardType)P.TA2;
|
SuperWildcardType suT2 = (SuperWildcardType)P.TA2;
|
||||||
//if(suT1.get_SuperType() instanceof RefType && suT2.get_SuperType() instanceof RefType) PL 15-01-30
|
if(suT1.get_SuperType() instanceof RefType && suT2.get_SuperType() instanceof RefType)
|
||||||
{
|
{
|
||||||
TA1 = (RefType)suT1.get_SuperType();
|
TA1 = (RefType)suT1.get_SuperType();
|
||||||
TA2 = (RefType)suT2.get_SuperType();
|
TA2 = (RefType)suT2.get_SuperType();
|
||||||
|
Loading…
Reference in New Issue
Block a user