Files
swift-mirror/test/Sema/accessibility_multi_module.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

28 lines
1.3 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -primary-file %S/Inputs/accessibility_multi_other_module.swift -emit-module-path %t/accessibility_multi_other_module.swiftmodule
// RUN: %target-swift-frontend -typecheck -I %t -primary-file %s -verify -verify-ignore-unrelated -verify-ignore-unknown
import accessibility_multi_other_module
func testPrivateConformance(_ instance: PrivateConformance) {
instance.publicExtensionMember()
// expected-error@-1 {{'publicExtensionMember' is inaccessible due to 'private' protection level}}
instance.internalExtensionMember()
// expected-error@-1 {{'internalExtensionMember' is inaccessible due to 'private' protection level}}
instance.publicFPExtensionMember()
// expected-error@-1 {{'publicFPExtensionMember' is inaccessible due to 'fileprivate' protection level}}
instance.internalFPExtensionMember()
// expected-error@-1 {{'internalFPExtensionMember' is inaccessible due to 'fileprivate' protection level}}
}
func testInternalConformance(_ instance: InternalConformance) {
instance.publicExtensionMember()
// expected-error@-1 {{'publicExtensionMember' is inaccessible due to 'internal' protection level}}
instance.internalExtensionMember()
// expected-error@-1 {{'internalExtensionMember' is inaccessible due to 'internal' protection level}}
}