Files
swift-mirror/test/NameLookup/members_transitive_underlying_clang.swift
Allan Shortlidge eba581eec2 AST: Add appropriate attributes to module import fix-its.
Make sure suggested imports are consistent with imports in other files. Also,
make sure the underlying clang module is always imported `@_exported`.
2024-04-16 16:29:51 -07:00

16 lines
1.0 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-frontend -typecheck -primary-file %t/Primary.swift %t/Other.swift -I %S/Inputs/MemberImportVisibility -module-name Underlying -verify -swift-version 5
// RUN: %target-swift-frontend -typecheck -primary-file %t/Primary.swift %t/Other.swift -I %S/Inputs/MemberImportVisibility -module-name Underlying -verify -swift-version 6
// RUN: %target-swift-frontend -typecheck -primary-file %t/Primary.swift %t/Other.swift -I %S/Inputs/MemberImportVisibility -module-name Underlying -verify -swift-version 5 -enable-experimental-feature MemberImportVisibility -verify-additional-prefix member-visibility-
//--- Other.swift
@_exported import Underlying
//--- Primary.swift
// expected-member-visibility-note@+1 {{add import of module 'Underlying'}}{{1-1=@_exported import Underlying\n}}
func test(_ s: UnderlyingStruct) {
_ = s.a // expected-member-visibility-error {{property 'a' is not available due to missing import of defining module 'Underlying'}}
}