From 6fd382580a1132119f67dd74a0b60cefc1bbbb48 Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Sun, 22 Nov 2015 15:58:10 +0100 Subject: [PATCH] Fixed AdaptSup --- .../dhbwstuttgart/typeinference/unifynew/RuleSet.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java b/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java index ddf365be..41741d8e 100644 --- a/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java +++ b/src/de/dhbwstuttgart/typeinference/unifynew/RuleSet.java @@ -412,17 +412,17 @@ public class RuleSet implements IRuleSet{ return Optional.empty(); - Optional opt = finiteClosure.getGenericType(((SuperType) typeDs).getSuperedType().getName()); + Optional 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 smArg = finiteClosure.smArg(typeSupDsgen); + Set 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++)