diff --git a/src/org/rascalmpl/library/lang/rascal/tests/basic/Sets.rsc b/src/org/rascalmpl/library/lang/rascal/tests/basic/Sets.rsc index ce930223f50..38e220533bc 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/basic/Sets.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/basic/Sets.rsc @@ -123,9 +123,18 @@ test bool tst_takeOneFrom(set[int] S) { test bool tst_getSingleFrom(set[int] S) { if ({e} := S) { - return getSingleFrom(s) == e; + return getSingleFrom(S) == e; } - return false; + return true; +} + +test bool tst_getSingleFromExample(str input) { + return getSingleFrom({input}) == input; +} + +@expected{CallFailed} +test bool tst_getSingleFromMore(str input, int i) { + getSingleFrom({input, i}); } test bool tst_toList(set[int] S) = isEmpty(S) || size(S) == size(toList(S)) && all(x <- S, x in toList(S)); diff --git a/src/org/rascalmpl/semantics/dynamic/Tree.java b/src/org/rascalmpl/semantics/dynamic/Tree.java index f69f8c750c5..d1bf20785f9 100644 --- a/src/org/rascalmpl/semantics/dynamic/Tree.java +++ b/src/org/rascalmpl/semantics/dynamic/Tree.java @@ -302,6 +302,7 @@ private IList flatten(IList args) { if (nestedArgs.length() > 0) { appendPreviousSeparators(args, result, delta, i, previousWasEmpty); result.appendAll(nestedArgs); + previousWasEmpty = false; } else { previousWasEmpty = true;