mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Type checker didn't handle the safe of disjoint optional chaining when trying to convert such chaining into `.Some` cases, which leads to dangling `BindOptionalExpr` in the AST. Resolves: rdar://problem/35870863
13 lines
175 B
Swift
13 lines
175 B
Swift
// RUN: %target-swift-frontend %s -typecheck
|
|
|
|
struct S {
|
|
let foo = "bar"
|
|
}
|
|
let s: S? = S()
|
|
let str: String? = "hello world"
|
|
|
|
switch str {
|
|
case s?.foo?: ()
|
|
default: ()
|
|
}
|