Aufruf im UnifyTest OverloadingVector ändern
This commit is contained in:
commit
5d760d4222
@ -287,7 +287,7 @@ public class RuleSet implements IRuleSet{
|
|||||||
if(lhsSType.getTypeParams().empty())
|
if(lhsSType.getTypeParams().empty())
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
||||||
UnifyType rhsType = pair.getLhsType();
|
UnifyType rhsType = pair.getRhsType();
|
||||||
ReferenceType rhsSType;
|
ReferenceType rhsSType;
|
||||||
|
|
||||||
if(rhsType instanceof ReferenceType)
|
if(rhsType instanceof ReferenceType)
|
||||||
|
@ -425,9 +425,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
protected Set<Set<UnifyPair>> unifyCase1(PlaceholderType a, UnifyType thetaPrime, IFiniteClosure fc) {
|
protected Set<Set<UnifyPair>> unifyCase1(PlaceholderType a, UnifyType thetaPrime, IFiniteClosure fc) {
|
||||||
Set<Set<UnifyPair>> result = new HashSet<>();
|
Set<Set<UnifyPair>> result = new HashSet<>();
|
||||||
|
|
||||||
boolean allGen = true;
|
boolean allGen = thetaPrime.getTypeParams().size() > 0;
|
||||||
for(UnifyType t : thetaPrime.getTypeParams())
|
for(UnifyType t : thetaPrime.getTypeParams())
|
||||||
if(t instanceof PlaceholderType && !((PlaceholderType) t).isGenerated()) {
|
if(!(t instanceof PlaceholderType) || !((PlaceholderType) t).isGenerated()) {
|
||||||
allGen = false;
|
allGen = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -437,7 +437,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
for(UnifyType c : cs) {
|
for(UnifyType c : cs) {
|
||||||
Set<UnifyType> thetaQs = fc.getChildren(c).stream().collect(Collectors.toCollection(HashSet::new));
|
Set<UnifyType> thetaQs = fc.getChildren(c).stream().collect(Collectors.toCollection(HashSet::new));
|
||||||
thetaQs.add(thetaPrime);
|
//thetaQs.add(thetaPrime);
|
||||||
Set<UnifyType> thetaQPrimes = new HashSet<>();
|
Set<UnifyType> thetaQPrimes = new HashSet<>();
|
||||||
TypeParams cParams = c.getTypeParams();
|
TypeParams cParams = c.getTypeParams();
|
||||||
if(cParams.size() == 0)
|
if(cParams.size() == 0)
|
||||||
@ -549,9 +549,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
protected Set<Set<UnifyPair>> unifyCase5(UnifyType theta, PlaceholderType a, IFiniteClosure fc) {
|
protected Set<Set<UnifyPair>> unifyCase5(UnifyType theta, PlaceholderType a, IFiniteClosure fc) {
|
||||||
Set<Set<UnifyPair>> result = new HashSet<>();
|
Set<Set<UnifyPair>> result = new HashSet<>();
|
||||||
|
|
||||||
boolean allGen = true;
|
boolean allGen = theta.getTypeParams().size() > 0;
|
||||||
for(UnifyType t : theta.getTypeParams())
|
for(UnifyType t : theta.getTypeParams())
|
||||||
if(t instanceof PlaceholderType && !((PlaceholderType) t).isGenerated()) {
|
if(!(t instanceof PlaceholderType) || !((PlaceholderType) t).isGenerated()) {
|
||||||
allGen = false;
|
allGen = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -865,10 +865,11 @@ public class UnifyTest {
|
|||||||
UnifyType gtv = tf.getSimpleType("gtv");
|
UnifyType gtv = tf.getSimpleType("gtv");
|
||||||
UnifyType vector = tf.getSimpleType("Vector", gtv);
|
UnifyType vector = tf.getSimpleType("Vector", gtv);
|
||||||
UnifyType vectorT2 = tf.getSimpleType("Vector", tphT2);
|
UnifyType vectorT2 = tf.getSimpleType("Vector", tphT2);
|
||||||
|
|
||||||
UnifyType string = tf.getSimpleType("String");
|
UnifyType string = tf.getSimpleType("String");
|
||||||
UnifyType vectorString = tf.getSimpleType("Vector", string);
|
UnifyType vectorString = tf.getSimpleType("Vector", string);
|
||||||
|
|
||||||
fcb.add(vector, vector);
|
fcb.add(vector, tf.getSimpleType("java.lang.Object"));
|
||||||
|
|
||||||
IFiniteClosure fc = fcb.getFiniteClosure();
|
IFiniteClosure fc = fcb.getFiniteClosure();
|
||||||
|
|
||||||
@ -879,7 +880,7 @@ public class UnifyTest {
|
|||||||
Set<Set<UnifyPair>> actual = new TypeUnify().unifySequential(eq, fc);
|
Set<Set<UnifyPair>> actual = new TypeUnify().unifySequential(eq, fc);
|
||||||
|
|
||||||
System.out.println("Test OverloadingVector:");
|
System.out.println("Test OverloadingVector:");
|
||||||
System.out.println(actual);
|
System.out.println(actual + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user