File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1771,6 +1771,9 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
1771
1771
}
1772
1772
1773
1773
static bool treatAsError = getenv (" ENABLE_PUBLIC_IMPORT_OF_PRIVATE_AS_ERROR" );
1774
+ #ifndef NDEBUG
1775
+ treatAsError = true ;
1776
+ #endif
1774
1777
if (!treatAsError)
1775
1778
inFlight.limitBehavior (DiagnosticBehavior::Warning);
1776
1779
}
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// REQUIRES: VENDOR=apple
3
+ // REQUIRES: asserts
3
4
4
5
/// Prepare the SDK.
5
6
// RUN: cp -r %S/Inputs/public-private-sdk %t/sdk
34
35
// RUN: -library-level other -D PUBLIC_IMPORTS
35
36
#if PUBLIC_IMPORTS
36
37
import PublicSwift
37
- import PrivateSwift // expected-warning {{private module 'PrivateSwift' is imported publicly from the public module 'main'}}
38
+ import PrivateSwift // expected-error {{private module 'PrivateSwift' is imported publicly from the public module 'main'}}
38
39
39
40
import PublicClang
40
- import PublicClang_Private // expected-warning {{private module 'PublicClang_Private' is imported publicly from the public module 'main'}}
41
- import FullyPrivateClang // expected-warning {{private module 'FullyPrivateClang' is imported publicly from the public module 'main'}}
41
+ import PublicClang_Private // expected-error {{private module 'PublicClang_Private' is imported publicly from the public module 'main'}}
42
+ import FullyPrivateClang // expected-error {{private module 'FullyPrivateClang' is imported publicly from the public module 'main'}}
42
43
import main // expected-warning{{'implementation-only-import-suggestion.swift' is part of module 'main'; ignoring import}}
43
44
44
45
/// Expect no warnings with implementation-only imports.
You can’t perform that action at this time.
0 commit comments