From ff0d1e907f782e4f40c98ab35b917ed6252590e1 Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Tue, 12 Apr 2016 13:21:17 +0200 Subject: [PATCH] fixed flattening of sets --- src/de/dhbwstuttgart/typeinference/unify/Unify.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/Unify.java b/src/de/dhbwstuttgart/typeinference/unify/Unify.java index 4d727591..71734187 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unify/Unify.java @@ -97,7 +97,12 @@ public class Unify { Set>> cartResult = setOps.cartesianProduct(secondLevelSetList); Set> flat = new HashSet<>(); - cartResult.stream().forEach(x -> flat.addAll(x)); + for(List> s : cartResult) { + Set flat1 = new HashSet<>(); + for(Set s1 : s) + flat1.addAll(s1); + flat.add(flat1); + } topLevelSets.add(flat); }