File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1055,8 +1055,15 @@ CheckInconsistentAccessLevelOnImport::evaluate(
1055
1055
auto mod = SF->getParentModule ();
1056
1056
auto diagnose = [mod](const ImportDecl *implicitImport,
1057
1057
const ImportDecl *otherImport) {
1058
- auto otherAccessLevel = otherImport->getAccessLevel ();
1058
+ // Ignore files generated by Xcode. We should probably identify them via
1059
+ // an attribuite or frontend flag, until them match the file by name.
1060
+ SourceFile *implicitSF =
1061
+ implicitImport->getDeclContext ()->getParentSourceFile ();
1062
+ StringRef basename = llvm::sys::path::filename (implicitSF->getFilename ());
1063
+ if (basename == " GeneratedAssetSymbols.swift" )
1064
+ return ;
1059
1065
1066
+ auto otherAccessLevel = otherImport->getAccessLevel ();
1060
1067
auto &diags = mod->getDiags ();
1061
1068
{
1062
1069
InFlightDiagnostic error =
Original file line number Diff line number Diff line change @@ -69,3 +69,16 @@ package import Lib // expected-note {{imported 'package' here}} @:1
69
69
import Lib
70
70
//--- ManyFiles_AmbiguitySwift6_FileB.swift
71
71
internal import Lib
72
+
73
+ /// Don't report inconsistencies from a file generated by Xcode.
74
+ // RUN: %target-swift-frontend -typecheck -I %t \
75
+ // RUN -primary-file %t/GeneratedAssetSymbols.swift \
76
+ // RUN: %t/UserWrittenFile.swift -verify
77
+ // RUN: %target-swift-frontend -typecheck -I %t \
78
+ // RUN %t/GeneratedAssetSymbols.swift \
79
+ // RUN: -primary-file %t/UserWrittenFile.swift -verify
80
+ //--- UserWrittenFile.swift
81
+ internal import Lib
82
+ //--- GeneratedAssetSymbols.swift
83
+ import Lib
84
+
You can’t perform that action at this time.
0 commit comments