Files
swift-mirror/test/Constraints/rdar38535743.swift
Pavel Yaskevich 298bf2aed4 [CSBindings] Cleanup literal binding inference
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
2018-03-27 22:51:37 -07:00

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
}