Files
swift-mirror/test/expr/capture/nested.swift
Doug Gregor 6337523879 Compute captures from the leaves up to the root.
Fixes <rdar://problem/13249017>.


Swift SVN r5049
2013-05-06 16:14:38 +00:00

13 lines
370 B
Swift

// RUN: %swift -dump-ast %s 2>&1 | FileCheck %s
// CHECK: func_decl "foo"
func foo(x:Int) -> (Int) -> (Int) -> Int {
// CHECK: func_expr type='(bar : Int) -> (Int) -> Int' captures=(x)
return func(bar:Int) -> (Int) -> Int {
// CHECK: func_expr type='(bas : Int) -> Int' captures=(x, bar)
return func(bas:Int) -> Int {
return x + bar + bas
}
}
}