Files
swift-mirror/test/Interpreter/capture_inout.swift
2016-08-10 23:52:02 -07:00

15 lines
210 B
Swift

// RUN: %target-run-simple-swift | %FileCheck %s
// REQUIRES: executable_test
func foo(_ x: inout Int) {
func bar() -> Int {
x += 1
return x
}
bar()
}
var x = 219
foo(&x)
print(x) // CHECK: 220