You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle cross-language duplications for missing dependencies (#696)
Instead of emitting diagnostics separately per language, this emits them together by first computing missing dependencies for each language and then merging/deduplicating them before diagnostic generation.
The code here will be forward compatible when we extend the Clang implementation to respect access levels and/or provide import locations.
data:DiagnosticData("The current toolchain does not support \(BuiltinMacros.VALIDATE_MODULE_DEPENDENCIES.name)"))]
132
+
returnnil
144
133
}
145
134
146
-
letmissingDeps= imports.filter{
135
+
return imports.filter{
147
136
// ignore module deps without source locations, these are inserted by swift / swift-build and we should treat them as implementation details which we can track without needing the user to declare them
148
137
if $0.importLocations.isEmpty {returnfalse}
149
138
150
139
// TODO: if the difference is just the access modifier, we emit a new entry, but ultimately our fixit should update the existing entry or emit an error about a conflict
151
140
if moduleDependencies.contains($0.0){returnfalse}
152
141
returntrue
153
142
}
143
+
}
144
+
145
+
/// Make diagnostics for missing module dependencies.
@Test(.requireSDKs(.host),.requireClangFeatures(.printHeadersDirectPerFile),.skipHostOS(.windows,"toolchain too old"),.skipHostOS(.linux,"toolchain too old"))
0 commit comments