@shapeshift-labs/frontier-lang-compiler 0.2.131 → 0.2.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -148,6 +148,7 @@ export function validateIndependentAdditions(base, workerPlan, headPlan, context
|
|
|
148
148
|
validateCrossSideAddedNames(workerPlan, headPlan, context);
|
|
149
149
|
validateCrossSideExportStarAdditions(workerPlan, headPlan, context);
|
|
150
150
|
validateCrossSideImportAdditions(workerPlan, headPlan, context);
|
|
151
|
+
validateMergedImportShapes(base, workerPlan, headPlan, context);
|
|
151
152
|
validateMergedImportAndDeclarationNames(base, workerPlan, headPlan, context);
|
|
152
153
|
}
|
|
153
154
|
|
|
@@ -234,6 +235,32 @@ function validateCrossSideImportAdditions(workerPlan, headPlan, context) {
|
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
|
|
238
|
+
function validateMergedImportShapes(base, workerPlan, headPlan, context) {
|
|
239
|
+
for (const entry of base.entries.filter((item) => item.kind === 'import')) {
|
|
240
|
+
const additions = [
|
|
241
|
+
...(workerPlan.importAdditions.get(entry.key) ?? []),
|
|
242
|
+
...(headPlan.importAdditions.get(entry.key) ?? [])
|
|
243
|
+
];
|
|
244
|
+
const namespaceAddition = additions.find((specifier) => specifier.additionKind === 'namespace');
|
|
245
|
+
if (!namespaceAddition) continue;
|
|
246
|
+
const namedAdditions = additions.filter((specifier) => !specifier.additionKind);
|
|
247
|
+
if (!entry.importInfo.specifiers.length && !namedAdditions.length) continue;
|
|
248
|
+
addConflict(context, {
|
|
249
|
+
code: JsTsSafeMergeConflictCodes.importShapeChanged,
|
|
250
|
+
gateId: JsTsSafeMergeGateIds.independentImportSpecifiers,
|
|
251
|
+
message: 'Merged imports would combine namespace and named import specifiers.',
|
|
252
|
+
details: {
|
|
253
|
+
key: entry.key,
|
|
254
|
+
namespace: namespaceAddition.localName,
|
|
255
|
+
namedSpecifiers: [
|
|
256
|
+
...entry.importInfo.specifiers.map((specifier) => specifier.canonical),
|
|
257
|
+
...namedAdditions.map((specifier) => specifier.canonical)
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
237
264
|
function validateMergedImportAndDeclarationNames(base, workerPlan, headPlan, context) {
|
|
238
265
|
const topLevelBindingNames = new Set();
|
|
239
266
|
for (const entry of base.entries.filter((item) => item.kind !== 'import')) {
|
package/package.json
CHANGED