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();
|
||||
|
||||
|
||||
Optional<Type> opt = finiteClosure.getGenericType(((SuperType) typeDs).getSuperedType().getName());
|
||||
Optional<Type> opt = finiteClosure.getGenericType(((SuperType) typeSupD).getSuperedType().getName());
|
||||
|
||||
if(!opt.isPresent())
|
||||
return Optional.empty();
|
||||
|
||||
Type typeDsgen = opt.get();
|
||||
Type typeSupDsgen = new SuperType(typeDsgen);
|
||||
Type typeDgen = opt.get();
|
||||
Type typeSupDgen = new SuperType(typeDgen);
|
||||
|
||||
// Use of smArg instead of grArg because
|
||||
// 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();
|
||||
|
||||
if(!opt.isPresent())
|
||||
@ -438,7 +438,7 @@ public class RuleSet implements IRuleSet{
|
||||
// New LHS
|
||||
Type newLhs = opt.get();
|
||||
TypeParams typeDParams = typeSupD.getTypeParams();
|
||||
TypeParams typeSupDsgenParams = typeSupDsgen.getTypeParams();
|
||||
TypeParams typeSupDsgenParams = typeSupDgen.getTypeParams();
|
||||
|
||||
Unifier unif = new Unifier(typeSupDsgenParams.get(0), typeDParams.get(0));
|
||||
for(int i = 1; i < typeDParams.size(); i++)
|
||||
|
Loading…
Reference in New Issue
Block a user