diff --git a/JavaExamples.java b/JavaExamples.java index 4c2ccaf..3babfd7 100644 --- a/JavaExamples.java +++ b/JavaExamples.java @@ -12,7 +12,9 @@ void foo(Set s) { // Mutating immut set, `new_s` is immut void foo1(@Mutable Set s) { Set new_s = new HashSet<>(s); + Set new_s1 = s; new_s.add("x"); // ERROR + new_s1.add("x"); //OK } // Mutating mut set