Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0143-rdar35870863.swift
Pavel Yaskevich ea0427e9f9 [TypeChecker] Fix crash related to chained optionals in case statements
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
2018-02-22 19:33:48 -08:00

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