Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export default class ExpressionValidator implements AstValidator<Expression> {
}
}

if (expr.$resolvedType?.decl === 'Unsupported') {
accept('error', 'Field of "Unsupported" type cannot be used in expressions', { node: expr });
}

// extra validations by expression type
switch (expr.$type) {
case 'BinaryExpr':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('Data Model Validation Tests', () => {
@@allow('all', a == 'a')
}
`)
).toMatchObject(errorLike('Field of "Unsupported" type cannot be used in expressions'));
).toMatchObject(errorLike('incompatible operand types'));
});

it('Using `this` in collection predicate', async () => {
Expand Down
15 changes: 15 additions & 0 deletions tests/regression/tests/issue-1870.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { loadModel, loadSchema } from '@zenstackhq/testtools';

describe('issue 1870', () => {
it('regression', async () => {
await loadModel(
`
model Polygon {
id Int @id @default(autoincrement())
geometry Unsupported("geometry(MultiPolygon, 4326)")
@@index([geometry], name: "parcel_polygon_idx", type: Gist)
}
`
);
});
});
Loading