Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0184-8764.swift
2018-12-10 00:00:49 -05:00

13 lines
353 B
Swift

// RUN: %target-swift-frontend -emit-ir %s
@discardableResult public func applyWrapped<T, U>(function: Optional<(T) -> U>, to value: Optional<T>) -> Optional<U> {
switch (function, value) {
case (let .some(f), let .some(v)):
return .some(f(v))
case (.none, _):
return .none
case (_, .none):
return .none
}
}