Files
swift-mirror/validation-test/compiler_crashers/24245-swift-constraints-constraintsystem-solve.swift
practicalswift d32f31b2c9 Add two crash cases.
These two cases were previously timeout cases (infinite running time) and
hence not included in validation-test/compiler_crashers/
2016-01-12 00:08:29 +01:00

14 lines
330 B
Swift

// RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
// Distributed under the terms of the MIT license
// Test case found by https://github.com/robrix (Rob Rix)
// http://www.openradar.me/19924870
func unit<T>(x: T) -> T? {
return x
}
func f() -> Int? {
return unit(1) ?? unit(2).map { 1 } ?? nil
}