mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Instead, introduce a new hasDependentMember() recursive property. The only place that cares about this is associated type inference, where I changed all existing hasTypeParameter() checks to instead check (hasTypeParameter() || hasDependentMember()). We could probably refine this over time and remove some of the hasTypeParameter() checks, but I'm being conservative for now. Fixes <https://bugs.swift.org/browse/SR-4575> and <rdar://problem/31603113>.
14 lines
326 B
Swift
14 lines
326 B
Swift
// RUN: not %target-swift-frontend %s -typecheck
|
|
struct V<T> : BidirectionalCollection {}
|
|
struct S {
|
|
func bar<T>(_ to: T.Type) -> V<T> {
|
|
return V<T>()
|
|
}
|
|
}
|
|
|
|
extension S {
|
|
func foo<R>(_ body: (UnsafeBufferPointer<UTF16.CodeUnit>) -> R) -> R {
|
|
return Array(self.bar(UTF16.self)).withUnsafeBufferPointer(body)
|
|
}
|
|
}
|