mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Simplifying into the function expression is wrong, like `FunctionArgument` this isn't an element that can be simplified. This also means we don't need to handle it in `MissingCallFailure`, since we shouldn't be recording that fix in this case.
16 lines
500 B
Swift
16 lines
500 B
Swift
// RUN: %target-typecheck-verify-swift %clang-importer-sdk
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
import CoreGraphics
|
|
|
|
func foo(_ x: Double) {}
|
|
func bar() -> Double { 0 }
|
|
|
|
// https://github.com/swiftlang/swift/issues/78376
|
|
let _: (CGFloat) -> Void = foo
|
|
// expected-error@-1 {{cannot convert value of type '(Double) -> ()' to specified type '(CGFloat) -> Void'}}
|
|
let _: () -> CGFloat = bar
|
|
// expected-error@-1 {{cannot convert value of type '() -> Double' to specified type '() -> CGFloat'}}
|