You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strings with restricted length, regular expressions (type inference for concatenation of restricted strings)
min/max / ranges for numbers (type inference for addition of ranges: <range> + <range>)
physical units
arrays with fixed length
Requirements:
Assignability/sub-type rules depend on the current DSL!
Provide general mechanism / API for "arbitrary" constrainted primitives
Maybe provide some defaults?
Maybe support additional properties (not generics Generics #26!) for types, which are not relevant for assignability/validation, but for code generation, e.g. UTF-8 encoding for strings?
Default behaviour of new parameters is empty, add more behaviour if required by explicit API calls for e.g. assignability, inference
Maybe these issues target not only primitive types, but any kinds of types?
Ideas for solution
It is possible to realize constrained primitive types with the custom type API, see: packages/typir/test/kinds/custom/custom-example-restricted.test.ts, but maybe there is an easier way.
Examples are:
<range> + <range>)Requirements:
Ideas for solution
packages/typir/test/kinds/custom/custom-example-restricted.test.ts, but maybe there is an easier way.