Skip to content

Commit ba9f6a2

Browse files
committed
[TypeChecker] NFC: Add a test-case for rdar://83666783
1 parent 7f94bbf commit ba9f6a2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -typecheck -verify
2+
// REQUIRES: objc_interop
3+
4+
import Foundation
5+
6+
struct S {
7+
var test: CGFloat
8+
}
9+
10+
func compute(_: Double?) -> Double? {
11+
return 42
12+
}
13+
14+
func test(s: S?) {
15+
_ = compute(s?.test) // expected-error {{cannot implicitly convert value of type 'CGFloat?' to expected type 'Double?'}}
16+
}

0 commit comments

Comments
 (0)