Skip to content

Instantly share code, notes, and snippets.

@niw
Last active April 3, 2020 17:52
Show Gist options
  • Save niw/3b1deb220b3615fa70d81b3d59119ce3 to your computer and use it in GitHub Desktop.
Save niw/3b1deb220b3615fa70d81b3d59119ce3 to your computer and use it in GitHub Desktop.
I found a SILOptimizer problem.
// `swiftc -Osize main.swift` then crash.
// Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29).
struct S {
}
struct T {
let s: S
}
class C {
func method() -> Any {
let t = f()
let r = (t != nil) ? 1 : nil
return (r, t?.s)
}
func f() -> T? {
return T(s: S())
}
}
@niw
Copy link
Author

niw commented Apr 2, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment