Skip to content

literalFits

literalFits(literal, valueType): boolean

Defined in: libs/language/src/typeqlite-annotations.ts:138

Whether a literal can constrain a value type — @values(0.1) cannot constrain an integer, @regex("A") nothing but a string, @range("A".."B") nothing but a string. The table is the specification’s own wrong value type outlines: an integer literal fits integer, double and decimal (no row refuses it there); a string fits string, and duration when it reads as one.

Literal

string

boolean

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.