forked from JavaTX/JavaCompilerCore
In Unify.subunify bei P.OperatorEqual() Wildcards loeschen
This commit is contained in:
parent
b4c0b17cf4
commit
57f35605f6
@ -1373,35 +1373,21 @@ throws MatchException
|
||||
//REDUCE2
|
||||
//PL 15-01-20: HIER MUESSEN NOCH ALLE FAELLE MIT EXTENDS UND SUPER GEMISCHT ERGAENZT WERDEN
|
||||
//BEACHTEN: WAS PASSIERT WENN HINTER ? extends/super EINE TYPVAR/KEIN REFTYPE STEHT
|
||||
//erledigt 15-02-03
|
||||
if(P.OperatorEqual())
|
||||
{
|
||||
//wenn noetig extends-wildcards entfernen PL 15-01-30
|
||||
//wenn noetig extends-wildcards entfernen PL 15-02-03
|
||||
//korrekt da P.OperatorEqual()
|
||||
if(P.TA1 instanceof ExtendsWildcardType && P.TA2 instanceof ExtendsWildcardType)
|
||||
|
||||
if(P.TA1 instanceof WildcardType)
|
||||
{
|
||||
ExtendsWildcardType exT1 = (ExtendsWildcardType)P.TA1;
|
||||
ExtendsWildcardType exT2 = (ExtendsWildcardType)P.TA2;
|
||||
|
||||
H.addElement(new Pair(exT1.get_ExtendsType(), exT2.get_ExtendsType()));
|
||||
|
||||
bRegel = true;
|
||||
continue;
|
||||
|
||||
P.TA1 = ((WildcardType)P.TA1).GetWildcardType();
|
||||
}
|
||||
if(P.TA2 instanceof WildcardType) {
|
||||
P.TA2 = ((WildcardType)P.TA2).GetWildcardType();
|
||||
}
|
||||
|
||||
//wenn noetig super-wildcards entfernen PL 15-01-30
|
||||
//korrekt da P.OperatorEqual()
|
||||
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;
|
||||
|
||||
}
|
||||
RefType TA1 = null;
|
||||
RefType TA2 = null;
|
||||
//Hier werden die RefTypes gefüllt.
|
||||
@ -1410,29 +1396,7 @@ throws MatchException
|
||||
TA1 = (RefType)P.TA1;
|
||||
TA2 = (RefType)P.TA2;
|
||||
}
|
||||
/* auskommentiert 15-01-30, da dies nict nur für RefTypes sonder für alle Typen gilt, am Anfang eingefügt.
|
||||
//FALSCH
|
||||
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 exT2 = (ExtendsWildcardType)P.TA2;
|
||||
if(exT1.get_ExtendsType() instanceof RefType && exT2.get_ExtendsType() instanceof RefType)
|
||||
{
|
||||
TA1 = (RefType)exT1.get_ExtendsType();
|
||||
TA2 = (RefType)exT2.get_ExtendsType();
|
||||
}
|
||||
}
|
||||
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 suT2 = (SuperWildcardType)P.TA2;
|
||||
if(suT1.get_SuperType() instanceof RefType && suT2.get_SuperType() instanceof RefType)
|
||||
{
|
||||
TA1 = (RefType)suT1.get_SuperType();
|
||||
TA2 = (RefType)suT2.get_SuperType();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if(TA1 != null && TA2 != null && TA1.getTypeName().equals(TA2.getTypeName()))
|
||||
{
|
||||
inferencelog.debug(" REDUCE2");
|
||||
|
@ -1,5 +1,5 @@
|
||||
class LambdaTest<A>{
|
||||
|
||||
Fun1<A, A> op = (var) -> {return var;};
|
||||
Fun1<Integer, Integer> op = (var) -> {return var;};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user