Files
swift-mirror/test/Constraints/rdar38625824.swift
Pavel Yaskevich 8688dde8b3 [CSSolver] Clarify generic disjunction choice favoring conditions
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
2018-04-03 15:25:28 -07:00

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")