forked from JavaTX/JavaCompilerCore
.
This commit is contained in:
parent
d89d06797e
commit
0be7534b98
@ -14,11 +14,13 @@ public class Unify_FC_TTO_Builder {
|
||||
|
||||
public void AddInheritance(Type t1, Type t2) {
|
||||
if(t1 instanceof RefType)
|
||||
classes.add(new Class(t1.get_Name(), t1.getOffset()));
|
||||
if(!classes.stream().anyMatch(x -> x.getName().equals(t1.getName())))
|
||||
classes.add(new Class(t1.get_Name(), t1.getOffset()));
|
||||
|
||||
if(t2 instanceof RefType)
|
||||
classes.add(new Class(t2.get_Name(), t2.getOffset()));
|
||||
|
||||
if(!classes.stream().anyMatch(x -> x.getName().equals(t2.getName())))
|
||||
classes.add(new Class(t2.get_Name(), t2.getOffset()));
|
||||
|
||||
fc.add(new Pair(t1, t2));
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,9 @@ public class UnifyTest extends Unify {
|
||||
|
||||
Set<MPair> eq = new HashSet<MPair>();
|
||||
Set<Set<MPair>> expected = new HashSet<>();
|
||||
expected.add(new HashSet<>());
|
||||
Set<Set<MPair>> actual = unify(eq, fc);
|
||||
Assert.assertEquals(actual, expected);
|
||||
Assert.assertEquals(expected, actual);
|
||||
|
||||
/*
|
||||
* Test 2:
|
||||
|
Loading…
Reference in New Issue
Block a user