Files
swift-mirror/test/Constraints/nil-coalescing-favoring.swift
Holly Borla c62e219ba2 [CSGen] Don't walk into ?? in LinkedExprAnalyzer.
Attempting to favor the type of this expression based on operand
types is wrong, because this operator attempts to unwrap its
operand types.
2021-11-05 21:12:59 -07:00

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