@primmel/primmel 1.21.0 → 1.21.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAmYA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AA8D7C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB;yEACqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAChC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AA+CD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,YAAiB,GACzB,UAAU,EAAE,CAgkNd;AAoBD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CAwFjE;AA4BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAOH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,EAAE,CAoCvE;AAUD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,EAAE,CAmFnE;AAWD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,EAAE,CAi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AE,CAoBhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,EAAE,CA8CnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,GACjB,UAAU,EAAE,CAuNd"}
package/dist/src/check.js CHANGED
@@ -2339,6 +2339,11 @@ function checkPackage(dir, options = {}) {
2339
2339
  const instrumentIds = new Set((standard.instruments ?? []).map(i => i.id));
2340
2340
  const instanceIds = new Set((standard.instances ?? []).map(i => i.id));
2341
2341
  const dataclassIds = new Set((standard.dataclasses ?? []).map(c => c.id));
2342
+ // The BARE-PREFIX link spelling: a class's extends may name a class
2343
+ // without its plane segment (Organization for Organization#data —
2344
+ // the language's own link spelling; the pre-1.21.0 checker and the
2345
+ // platform linker resolve it). C156 resolves both spellings.
2346
+ const dataclassBareIds = new Set((standard.dataclasses ?? []).map(c => c.id.split('#')[0]));
2342
2347
  const attrScopes = new Map((standard.attributeDefinitions ?? []).map(a => [a.id, a.scope]));
2343
2348
  // Classification-dimension scopes, by every spelling a classification
2344
2349
  // map may use: the instrument dimension id, the is_dimension attribute
@@ -2477,6 +2482,7 @@ function checkPackage(dir, options = {}) {
2477
2482
  for (const c of standard.dataclasses ?? []) {
2478
2483
  if (c.extends &&
2479
2484
  !dataclassIds.has(c.extends) &&
2485
+ !dataclassBareIds.has(c.extends) &&
2480
2486
  !instanceIds.has(c.extends)) {
2481
2487
  warn('C156', `class ${c.id}: extends "${c.extends}" is not a declared class or instance (class-extends-resolves)`);
2482
2488
  }
@@ -3361,6 +3367,13 @@ function checkPackage(dir, options = {}) {
3361
3367
  }
3362
3368
  const unitToKind = new Map(); // unit id|symbol → kind id
3363
3369
  const unitHome = new Map(); // unit id|symbol → register id
3370
+ // The full entry behind each key: a redeclaration that is
3371
+ // IDENTICAL (same kind, factor, symbol) is idempotent under
3372
+ // composition — the sibling IEC packages each declare kV/degC for
3373
+ // standalone self-containment, and the merged register set carries
3374
+ // one shared entry, not a conflict. Only a CONFLICTING entry (the
3375
+ // same key, different meaning) is a redefinition.
3376
+ const unitEntry = new Map(); // key → kind|factor|symbol
3364
3377
  const registersExist = (standard.quantityRegisters ?? []).length > 0;
3365
3378
  for (const reg of standard.quantityRegisters ?? []) {
3366
3379
  for (const u of reg.units) {
@@ -3370,13 +3383,17 @@ function checkPackage(dir, options = {}) {
3370
3383
  }
3371
3384
  // C33 — no cross-register redefinition: a rec EXTENDS the register
3372
3385
  // with domain units; it never redefines an existing entry.
3386
+ const entry = `${u.kind}|${u.factorToSI}|${u.offsetToSI ?? ''}|${u.symbol}`;
3373
3387
  for (const key of new Set([u.id, u.symbol].filter(s => s))) {
3374
3388
  const prior = unitHome.get(key);
3375
3389
  if (prior !== undefined) {
3376
- err('C33', `quantity_register ${reg.id}: unit "${u.id}" ("${key}") redefines a unit already declared by register "${prior}" — a package extends the register, it never redefines entries (quantity-coherence)`);
3390
+ if (unitEntry.get(key) !== entry) {
3391
+ err('C33', `quantity_register ${reg.id}: unit "${u.id}" ("${key}") redefines a unit already declared by register "${prior}" — a package extends the register, it never redefines entries (quantity-coherence)`);
3392
+ }
3377
3393
  }
3378
3394
  else {
3379
3395
  unitHome.set(key, reg.id);
3396
+ unitEntry.set(key, entry);
3380
3397
  unitToKind.set(key, u.kind);
3381
3398
  }
3382
3399
  }