Skip to content

Commit c68b1c5

Browse files
committed
update
1 parent da73bd3 commit c68b1c5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/language/src/zmodel-scope.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import {
3636
getAuthDecl,
3737
getRecursiveBases,
3838
isAuthInvocation,
39-
isCollectionPredicate,
4039
isBeforeInvocation,
40+
isCollectionPredicate,
4141
resolveImportUri,
4242
} from './utils';
4343

@@ -75,7 +75,7 @@ export class ZModelScopeComputation extends DefaultScopeComputation {
7575

7676
override processNode(node: AstNode, document: LangiumDocument<AstNode>, scopes: PrecomputedScopes) {
7777
super.processNode(node, document, scopes);
78-
if (isDataModel(node)) {
78+
if (isDataModel(node) || isTypeDef(node)) {
7979
// add base fields to the scope recursively
8080
const bases = getRecursiveBases(node);
8181
for (const base of bases) {

tests/regression/test/v2-migrated/issue-971.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ import { it } from 'vitest';
44
it('verifies issue 971', async () => {
55
await loadSchema(
66
`
7-
abstract model Level1 {
7+
type Level1 {
88
id String @id @default(cuid())
99
URL String?
1010
@@validate(URL != null, "URL must be provided") // works
1111
}
12-
abstract model Level2 extends Level1 {
12+
type Level2 with Level1 {
1313
@@validate(URL != null, "URL must be provided") // works
1414
}
15-
abstract model Level3 extends Level2 {
15+
type Level3 with Level2 {
1616
@@validate(URL != null, "URL must be provided") // doesn't work
1717
}
18-
model Foo extends Level3 {
18+
model Foo with Level3 {
1919
}
2020
`,
2121
);

0 commit comments

Comments
 (0)