Files
swift-mirror/test/Constraints/issue-78376.swift
Hamish Knight 86e8165569 [CS] Don't simplify FunctionResult in simplifyLocator
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.
2024-12-29 12:25:18 +00:00

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'}}