mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
17c12affb8
Add test cases for various edge cases related to conformances with MemberImportVisibility enabled. Missing imports that break conformances should be diagnosed, but those diagnostics should not prevent certain accepted conformances from continuing to be accepted. Tests only, NFC.
41 lines
1.3 KiB
Swift
41 lines
1.3 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
|
|
// Build the supporting modules.
|
|
// RUN: %target-swift-frontend -emit-module %t/ProtoModule.swift -o %t \
|
|
// RUN: -module-name ProtoModule -swift-version 5 -enable-library-evolution
|
|
// RUN: %target-swift-frontend -emit-module %t/RefinementModule.swift -o %t \
|
|
// RUN: -I %t -module-name RefinementModule -swift-version 5 -enable-library-evolution
|
|
|
|
// Typecheck the handwritten swiftinterface. This should succeed without errors
|
|
// even when MemberImportVisibility is enabled, because swiftinterfaces are
|
|
// generated from valid source and conformance witnesses should not trigger
|
|
// import visibility diagnostics.
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/Client.swiftinterface) \
|
|
// RUN: -module-name Client -I %t -enable-upcoming-feature MemberImportVisibility
|
|
|
|
// REQUIRES: swift_feature_MemberImportVisibility
|
|
|
|
//--- ProtoModule.swift
|
|
|
|
public protocol Proto {
|
|
func witnessMe()
|
|
}
|
|
|
|
extension Proto {
|
|
public func witnessMe() { }
|
|
}
|
|
|
|
//--- RefinementModule.swift
|
|
|
|
import ProtoModule
|
|
|
|
public protocol RefinedProto: Proto { }
|
|
|
|
//--- Client.swiftinterface
|
|
// swift-interface-format-version: 1.0
|
|
// swift-module-flags: -swift-version 5 -enable-library-evolution -module-name Client -enable-upcoming-feature MemberImportVisibility
|
|
import RefinementModule
|
|
|
|
struct S: RefinedProto {}
|