We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10a07e3 commit 15c5406Copy full SHA for 15c5406
1 file changed
JavaExamples.java
@@ -12,7 +12,9 @@ void foo(Set<String> s) {
12
// Mutating immut set, `new_s` is immut
13
void foo1(@Mutable Set<String> s) {
14
Set<String> new_s = new HashSet<>(s);
15
+ Set<String> new_s1 = s;
16
new_s.add("x"); // ERROR
17
+ new_s1.add("x"); //OK
18
}
19
20
// Mutating mut set
0 commit comments