mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This is modeled in constraint system in a way that when member type is resolved by `resolveOverload` it would take r-value type of the element at specified index, but if it's a type variable it could still be bound to l-value later, so r-value result has to be enforced by coercion if necessary. Resolves: rdar://problem/39931475
10 lines
173 B
Swift
10 lines
173 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P {
|
|
func b(i: @escaping (inout Int) -> Double)
|
|
}
|
|
|
|
func foo<T: P>(_ bar: T) {
|
|
_ = bar.b { a in Double((a, a += 1).0) }
|
|
}
|