forked from JavaTX/JavaCompilerCore
extended case 5
This commit is contained in:
parent
5c73224f8f
commit
41b3e4f6c2
@ -463,7 +463,14 @@ public class Unify {
|
|||||||
Set<Set<UnifyPair>> result = new HashSet<>();
|
Set<Set<UnifyPair>> result = new HashSet<>();
|
||||||
for(UnifyType thetaS : fc.greater(theta)) {
|
for(UnifyType thetaS : fc.greater(theta)) {
|
||||||
Set<UnifyPair> resultPrime = new HashSet<>();
|
Set<UnifyPair> resultPrime = new HashSet<>();
|
||||||
resultPrime.add(new UnifyPair(a, thetaS, PairOperator.EQUALSDOT));
|
|
||||||
|
UnifyType[] freshTphs = new UnifyType[thetaS.getTypeParams().size()];
|
||||||
|
for(int i = 0; i < freshTphs.length; i++) {
|
||||||
|
freshTphs[i] = PlaceholderType.freshPlaceholder();
|
||||||
|
resultPrime.add(new UnifyPair(thetaS.getTypeParams().get(i), freshTphs[i], PairOperator.SMALLERDOTWC));
|
||||||
|
}
|
||||||
|
|
||||||
|
resultPrime.add(new UnifyPair(a, thetaS.setTypeParams(new TypeParams(freshTphs)), PairOperator.EQUALSDOT));
|
||||||
result.add(resultPrime);
|
result.add(resultPrime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,11 +457,28 @@ public class UnifyTest extends Unify {
|
|||||||
//Assert.assertEquals(expected, actual);
|
//Assert.assertEquals(expected, actual);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test 4:
|
* Case 4 has no extension
|
||||||
* This is a test for the extension of case 4 of the cartesian product of step 4.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test 5:
|
||||||
|
* This is a test for the extension of case 5 of the cartesian product of step 4.
|
||||||
|
*
|
||||||
|
* Vector<b> <. a
|
||||||
|
* b =. Number
|
||||||
|
*/
|
||||||
|
|
||||||
|
eq = new HashSet<>();
|
||||||
|
eq.add(new UnifyPair(tf.getSimpleType("HashSet", tphB), tphA, PairOperator.SMALLERDOT));
|
||||||
|
eq.add(new UnifyPair(tphB, number, PairOperator.EQUALSDOT));
|
||||||
|
|
||||||
|
expected = new HashSet<>();
|
||||||
|
|
||||||
|
actual = unify(eq, fc);
|
||||||
|
|
||||||
|
System.out.println(actual);
|
||||||
|
//Assert.assertEquals(expected, actual);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user