Validates a value against this type and returns its canonical form,
or null on mismatch.
Rules, identical in every runtime:
null is valid only for optional types.int value is accepted where double is declared and is
canonicalized to double, mirroring expression promotion. A
double value never satisfies an int declaration.enum declaration is satisfied only by one of its members.null.StaticarrayStaticboolStaticdoubleStaticenumerationA closed set of member strings. Two enum types are the same exactly when their member sets are equal: enum identity is structural, like records.
StaticfromParses a JSON type descriptor:
? for optional ("int", "string?"){"enum": [<member>...], "optional": <bool>}{"array": <descriptor>, "optional": <bool>}{"record": {<field>: <descriptor>}, "optional": <bool>}StaticintStaticrecordStaticsameKind equality, member-aware for enums and structural for records.
Staticstring
The name used in error details: the kind, with
?when optional.