mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We might infer internal function labels as `$0` from a closure with which a variable is initialised. But we don’t want to print the function signature as `(_ $0: Int) -> Int` because `$0` is not a valid variable name to declare. So, in the case described above, only print the type. Fixes rdar://77462547
13 lines
450 B
Swift
13 lines
450 B
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
|
|
// RUN: %FileCheck %s < %t/main.swiftinterface
|
|
|
|
// CHECK: import Swift
|
|
|
|
// CHECK: public let MyClosureVar: (Swift.Int) -> Swift.Int
|
|
public let MyClosureVar: (Int) -> Int = { $0 }
|
|
|
|
// CHECK: public var MyOtherClosureVar: (_ x: Swift.Int) -> Swift.Int
|
|
public let MyOtherClosureVar: (_ x: Int) -> Int
|