Files
swift-mirror/test/Constraints/rdar39931475.swift
Pavel Yaskevich 58fb0ac6a7 [CSApply] Make sure that indexing into an r-value tuple produces r-value
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
2018-05-16 00:20:46 -07:00

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