forked from JavaTX/JavaCompilerCore
Fixed AdaptSup
This commit is contained in:
parent
9552831d4e
commit
6fd382580a
@ -412,17 +412,17 @@ public class RuleSet implements IRuleSet{
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
||||||
|
|
||||||
Optional<Type> opt = finiteClosure.getGenericType(((SuperType) typeDs).getSuperedType().getName());
|
Optional<Type> opt = finiteClosure.getGenericType(((SuperType) typeSupD).getSuperedType().getName());
|
||||||
|
|
||||||
if(!opt.isPresent())
|
if(!opt.isPresent())
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
||||||
Type typeDsgen = opt.get();
|
Type typeDgen = opt.get();
|
||||||
Type typeSupDsgen = new SuperType(typeDsgen);
|
Type typeSupDgen = new SuperType(typeDgen);
|
||||||
|
|
||||||
// Use of smArg instead of grArg because
|
// Use of smArg instead of grArg because
|
||||||
// a in grArg(b) => b in smArg(a)
|
// a in grArg(b) => b in smArg(a)
|
||||||
Set<Type> smArg = finiteClosure.smArg(typeSupDsgen);
|
Set<Type> smArg = finiteClosure.smArg(typeSupDgen);
|
||||||
opt = smArg.stream().filter(x -> x.getName().equals(typeDs.getName())).findAny();
|
opt = smArg.stream().filter(x -> x.getName().equals(typeDs.getName())).findAny();
|
||||||
|
|
||||||
if(!opt.isPresent())
|
if(!opt.isPresent())
|
||||||
@ -438,7 +438,7 @@ public class RuleSet implements IRuleSet{
|
|||||||
// New LHS
|
// New LHS
|
||||||
Type newLhs = opt.get();
|
Type newLhs = opt.get();
|
||||||
TypeParams typeDParams = typeSupD.getTypeParams();
|
TypeParams typeDParams = typeSupD.getTypeParams();
|
||||||
TypeParams typeSupDsgenParams = typeSupDsgen.getTypeParams();
|
TypeParams typeSupDsgenParams = typeSupDgen.getTypeParams();
|
||||||
|
|
||||||
Unifier unif = new Unifier(typeSupDsgenParams.get(0), typeDParams.get(0));
|
Unifier unif = new Unifier(typeSupDsgenParams.get(0), typeDParams.get(0));
|
||||||
for(int i = 1; i < typeDParams.size(); i++)
|
for(int i = 1; i < typeDParams.size(); i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user