mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't attempt to store literal bindings directly to `PotentialBindings` since they might get superseded by non-literal bindings deduced from other constraints, also don't attempt to check literal protocol conformance on type variables or member types since such types would always end-up returning trivial conformance which results in removal of viable literal types. Resolves: rdar://problem/38535743
15 lines
285 B
Swift
15 lines
285 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
protocol P {}
|
|
|
|
class C {
|
|
init<T: NSObject>(values: [T]) where T: P {}
|
|
}
|
|
|
|
func foo<T: NSObject>(value: T) where T: P {
|
|
_ = C(values: [value]) // Ok
|
|
}
|