Files
swift-mirror/test/Constraints/one_way_closure_params.swift
Holly Borla c297070106 [Diagnostics] Always use the parameter name for closure parameter diagnostics,
because the $ prefix does not indicate that the parameter is anonymous.
2021-05-11 18:30:27 -07:00

9 lines
270 B
Swift

// RUN: %target-typecheck-verify-swift -swift-version 4 -experimental-one-way-closure-params
func testBasic() {
let _: (Float) -> Float = { $0 + 1 }
let _ = { $0 + 1 } // expected-error{{unable to infer type of a closure parameter '$0' in the current context}}
}