Files
swift-mirror/test/Generics/requirement_inference_objc.swift
Nate Chandler 594e690a00 [Test] Added new redundancy warnings.
Now that `InferredGenericSignatureRequest` creates
`StructuralRequirement`s from of the generic signature with valid source
locations, additional redundancy warnings are produced.  Update tests
with the new warnings.
2023-05-17 15:16:23 -07:00

20 lines
448 B
Swift

// RUN: %target-typecheck-verify-swift -warn-redundant-requirements
// REQUIRES: objc_interop
// rdar://problem/30610428
@objc protocol P14 { }
class X12<S: AnyObject> {
func bar<V>(v: V) where S == P14 { // expected-warning {{redundant constraint 'S' : 'AnyObject'}}
}
}
@objc protocol P15: P14 { }
class X13<S: P14> {
func bar<V>(v: V) where S == P15 { // expected-warning {{redundant conformance constraint 'any P15' : 'P14'}}
}
}