mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Check for use of implementation-only conformances in inlinable code
This includes both the types and the values (generic functions, etc) used in the inlinable code. We get some effectively duplicate diagnostics at this point because of this, but we can deal with that at a future date. Last part of rdar://problem/48991061
This commit is contained in:
@@ -64,6 +64,7 @@ public protocol TestAssocTypeWhereClause {
|
||||
|
||||
public enum TestRawType: IntLike { // expected-error {{cannot use 'IntLike' here; 'BADLibrary' has been imported as '@_implementationOnly'}}
|
||||
case x = 1
|
||||
// FIXME: expected-error@-1 {{cannot use conformance of 'IntLike' to 'Equatable' here; 'BADLibrary' has been imported as '@_implementationOnly'}}
|
||||
}
|
||||
|
||||
public class TestSubclass: BadClass { // expected-error {{cannot use 'BadClass' here; 'BADLibrary' has been imported as '@_implementationOnly'}}
|
||||
@@ -245,3 +246,13 @@ public struct RequirementsHandleSpecializationsToo: SlightlyMoreComplicatedRequi
|
||||
public struct ClassConstrainedGenericArg<T: NormalClass>: PublicInferredAssociatedType { // expected-error {{cannot use conformance of 'NormalClass' to 'NormalProto' in associated type 'Self.Assoc' (inferred as 'T'); 'BADLibrary' has been imported as '@_implementationOnly'}}
|
||||
public func takesAssoc(_: T) {}
|
||||
}
|
||||
|
||||
|
||||
public protocol RecursiveRequirements {
|
||||
associatedtype Other: RecursiveRequirements
|
||||
}
|
||||
extension GenericStruct: RecursiveRequirements {
|
||||
public typealias Other = GenericStruct<T>
|
||||
}
|
||||
public struct RecursiveRequirementsHolder<T: RecursiveRequirements> {}
|
||||
public func makeSureRecursiveRequirementsDontBreakEverything(_: RecursiveRequirementsHolder<GenericStruct<Int>>) {}
|
||||
|
||||
Reference in New Issue
Block a user