@zenstackhq/language 3.0.0-beta.29 → 3.0.0-beta.30

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.
package/dist/index.cjs CHANGED
@@ -5608,13 +5608,23 @@ function getAllAttributes(decl, seen = /* @__PURE__ */ new Set()) {
5608
5608
  }
5609
5609
  if (isDataModel(decl) && decl.baseModel) {
5610
5610
  if (decl.baseModel.ref) {
5611
- attributes.push(...getAllAttributes(decl.baseModel.ref, seen));
5611
+ const attrs = getAllAttributes(decl.baseModel.ref, seen).filter((attr) => !isNonInheritableAttribute(attr));
5612
+ attributes.push(...attrs);
5612
5613
  }
5613
5614
  }
5614
5615
  attributes.push(...decl.attributes);
5615
5616
  return attributes;
5616
5617
  }
5617
5618
  __name(getAllAttributes, "getAllAttributes");
5619
+ function isNonInheritableAttribute(attr) {
5620
+ const attrName = attr.decl.ref?.name ?? attr.decl.$refText;
5621
+ return [
5622
+ "@@map",
5623
+ "@@unique",
5624
+ "@@index"
5625
+ ].includes(attrName);
5626
+ }
5627
+ __name(isNonInheritableAttribute, "isNonInheritableAttribute");
5618
5628
  function getDocument(node) {
5619
5629
  const rootNode = findRootNode(node);
5620
5630
  const result = rootNode.$document;
@@ -6412,7 +6422,7 @@ var DataModelValidator = class {
6412
6422
  if (!thisRelation.valid) {
6413
6423
  return;
6414
6424
  }
6415
- if (this.isFieldInheritedFromDelegateModel(field)) {
6425
+ if (this.isFieldInheritedFromDelegateModel(field, contextModel)) {
6416
6426
  return;
6417
6427
  }
6418
6428
  if (this.isSelfRelation(field)) {
@@ -6535,8 +6545,8 @@ var DataModelValidator = class {
6535
6545
  }
6536
6546
  }
6537
6547
  // checks if the given field is inherited directly or indirectly from a delegate model
6538
- isFieldInheritedFromDelegateModel(field) {
6539
- return isDelegateModel(field.$container);
6548
+ isFieldInheritedFromDelegateModel(field, contextModel) {
6549
+ return field.$container !== contextModel && isDelegateModel(field.$container);
6540
6550
  }
6541
6551
  validateInherits(model, accept) {
6542
6552
  if (!model.baseModel) {