Avatar
Avatar
niw
@swift-5.9.2 class Box<T> { private var value: T init(_ value: T) { self.value = value } func mutate(_ mutation: (inout T) -> Void) { mutation(&self.value) } } func f() { let box = Box { } let s = "meow" box.mutate { value in value = { s } } } f()
exit status: 134 with <stdin>:22:13: warning: expression of type 'String' is unused s ^
9.52 KB