mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Attempt to avoid trying to optimize binary generic disjunctions when one of the choices has `Any` or `Any?` since it's risky to assume which one is better without solving. Resolves: rdar://problem/38625824
12 lines
305 B
Swift
12 lines
305 B
Swift
// RUN: %target-swift-frontend -emit-sil -verify %s | %FileCheck %s
|
|
func foo<T>(_: Any) -> T {
|
|
fatalError()
|
|
}
|
|
|
|
func foo<T>(_: Any?) -> T {
|
|
fatalError()
|
|
}
|
|
|
|
// CHECK: function_ref @$S12rdar386258243fooyxyplF : $@convention(thin) <τ_0_0> (@in_guaranteed Any) -> @out τ_0_0
|
|
var _: String = foo("hello")
|