Swift: compiler crash on enum inference after optional chaining

Originator:jdhealy
Number:rdar://19744740 Date Originated:06-Feb-2015 11:25 AM
Status:Closed Resolved:11-Feb-2015 11:13 AM
Product:Developer Tools Product Version:/Applications/Xcode-6ยท2-Beta-4.app
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
`swift-600.0.57.3` compiler crash on enum inference after optional chaining.

Steps to Reproduce:
1. Compile

```swift
import Foundation

Optional("HELLO WORLD" as NSString)?.caseInsensitiveCompare("hello world") == .OrderedSame ?? false
```

Expected Results:
`.OrderedSame` is inferred as `NSComparisonResult.OrderedSame`. Program compiles.

Actual Results:
Compiler crashes. See `swift-output.text` in attachment zip.

Regression:
Prepending `NSComparisonResult` to `.OrderedSame` makes the program compile.

Notes:
<https://github.com/jdhealy/Carthage/commit/2ff24a21ec99034ea3ddfbabf8c86bfb112c43df>

Comments

Closed

Compile does not crash as of Apple Swift version 1.2 (swiftlang-602.0.37.3 clang-602.0.37).

Program compiles and runs correctly.

This issue has been verified as resolved and can be closed.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!