File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1923,15 +1923,11 @@ ImportedModule::removeDuplicates(SmallVectorImpl<ImportedModule> &imports) {
19231923}
19241924
19251925Identifier ModuleDecl::getPublicModuleName (bool onlyIfImported) const {
1926- if (!PublicModuleName.empty ()) {
1927- if (!onlyIfImported)
1928- return PublicModuleName;
1926+ if (!PublicModuleName.empty () &&
1927+ (!onlyIfImported ||
1928+ getASTContext ().getLoadedModule (PublicModuleName)))
1929+ return PublicModuleName;
19291930
1930- bool publicModuleIsImported =
1931- getASTContext ().getModuleByIdentifier (PublicModuleName);
1932- if (publicModuleIsImported)
1933- return PublicModuleName;
1934- }
19351931 return getName ();
19361932}
19371933
Original file line number Diff line number Diff line change 4747// RUN: -verify
4848// RUN: not %target-swift-frontend -typecheck %t/ClientMiddle.swift -o %t -I %t \
4949// RUN: -enable-library-evolution -swift-version 6 \
50+ // RUN: -diagnostic-style llvm \
5051// RUN: 2>&1 | %FileCheck %t/ClientMiddle.swift
5152
5253/// Test more diagnostics referencing modules.
6970// RUN: -verify
7071// RUN: not %target-swift-frontend -typecheck %t/ClientMiddle.swift -o %t -I %t \
7172// RUN: -enable-library-evolution -swift-version 6 \
73+ // RUN: -diagnostic-style llvm \
7274// RUN: 2>&1 | %FileCheck %t/ClientMiddle.swift
7375
7476// RUN: %target-swift-frontend -typecheck %t/ClientAccessLevelOnImports.swift -o %t -I %t \
You can’t perform that action at this time.
0 commit comments