mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Attempting to favor the type of this expression based on operand types is wrong, because this operator attempts to unwrap its operand types.
15 lines
321 B
Swift
15 lines
321 B
Swift
// RUN: %target-swift-frontend -dump-ast %s | %FileCheck %s
|
|
|
|
struct B {
|
|
static var _none: B { B() }
|
|
}
|
|
|
|
struct A {
|
|
init(_ other: B) {}
|
|
// CHECK: constructor_decl{{.*}}interface type='(A.Type) -> (B?) -> A'
|
|
init(_ other: B?) {
|
|
// CHECK: dot_syntax_call_expr type='(B) -> A'
|
|
self.init(other ?? ._none)
|
|
}
|
|
}
|