alle Faelle P.OperatorSmallerExtends eingefuegt

This commit is contained in:
Martin Plümicke 2015-02-17 23:23:02 +01:00
parent acd20842e2
commit 4e61ba736d

View File

@ -1519,14 +1519,25 @@ throws MatchException
continue;
}
if (P.OperatorSmallerExtends()) //PL 15-02-03 Es muessen noch alle Fälle betrachtet werden.
if (P.OperatorSmallerExtends()) //PL 15-02-17 alle eingefuegt
{
if(P.TA1 instanceof ExtendsWildcardType && P.TA2 instanceof ExtendsWildcardType)
{
inferencelog.debug(" Extends <? Extends");
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),((WildcardType)P.TA2).GetWildcardType(), PairOperator.Equal));
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),((WildcardType)P.TA2).GetWildcardType(), PairOperator.Smaller));
bRegel = true;
continue;
}
if(!(P.TA1 instanceof WildcardType) && P.TA2 instanceof ExtendsWildcardType)
{
inferencelog.debug(" TA1 <? Extends");
H.add(new Pair(P.TA1,((WildcardType)P.TA2).GetWildcardType(), PairOperator.Smaller));
bRegel = true;
continue;
@ -1537,7 +1548,18 @@ throws MatchException
inferencelog.debug(" Super <? Super");
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),((WildcardType)P.TA2).GetWildcardType(), PairOperator.Equal));
H.add(new Pair(((WildcardType)P.TA2).GetWildcardType(),((WildcardType)P.TA1).GetWildcardType(), PairOperator.Smaller));
bRegel = true;
continue;
}
if(!(P.TA1 instanceof WildcardType) && P.TA2 instanceof SuperWildcardType)
{
inferencelog.debug(" TA1 <? Super");
H.add(new Pair(((WildcardType)P.TA2).GetWildcardType(), P.TA1, PairOperator.Smaller));
bRegel = true;
continue;
@ -1548,29 +1570,31 @@ throws MatchException
inferencelog.debug(" Extends <? Super");
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),((WildcardType)P.TA2).GetWildcardType(), PairOperator.Smaller));
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),((WildcardType)P.TA2).GetWildcardType(), PairOperator.Equal));
bRegel = true;
continue;
}
//PL 15-02-08
if(P.TA1 instanceof WildcardType && ((WildcardType)P.TA1).GetWildcardType() instanceof TypePlaceholder
&& (P.TA2 instanceof GenericTypeVar || P.TA2 instanceof RefType))
if(P.TA1 instanceof SuperWildcardType && P.TA2 instanceof ExtendsWildcardType)
{
inferencelog.debug(" Super <? Extends");
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),((WildcardType)P.TA2).GetWildcardType(), PairOperator.Equal));
bRegel = true;
continue;
}
//PL 15-02-08 angepasst 15-02-17
if(P.TA1 instanceof WildcardType && !(P.TA2 instanceof WildcardType))
{
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),P.TA2, PairOperator.Equal));
bRegel = true;
continue;
}
//PL 15-02-08 bisher mit keinem Beispiel getestet
if((P.TA1 instanceof GenericTypeVar || P.TA1 instanceof RefType)
&& (P.TA2 instanceof WildcardType && ((WildcardType)P.TA2).GetWildcardType() instanceof TypePlaceholder))
{
H.add(new Pair(((WildcardType)P.TA1).GetWildcardType(),P.TA2, PairOperator.Equal));
bRegel = true;
continue;
}
}
// Subst --> noch zu pr<EFBFBD>fen