Files
swift-mirror/test/expr/capture/inout.swift
2016-02-26 01:33:22 -08:00

17 lines
316 B
Swift

// RUN: %target-parse-verify-swift
// An inout parameter can be captured.
func foo(x: inout Int) {
func bar() -> Int {
return x
}
}
// But not partially applied.
struct C {
mutating func f(x: Int) {}
}
var c = C()
let x = c.f // expected-error{{partial application of 'mutating' method is not allowed}}