Closed adampauls closed 4 hours ago
This is working correctly. You're attempting to assign a value to a TypeForm
type that does not come from a valid type expression. You'd see a similar error if you attempted to use the expression type(s)
in a type annotation.
I'm aware the spec is not yet finalized and that the implementation is experimental. I'm also not clear on what the (current) spec says here.
Describe the bug
The spec says:
str
is unambiguously a type expression, whose resulting value is unambiguously a "type form object" as per the spec.type(s)
evaluates tostr
, so I believetype(s)
evaluates to a "type form object", but it's possible the spec is not being clear here. If it is true thattype(s)
evaluates to a type form object, then surely it must be assignable toTypeForm
.It's possible the intent of the spec is that
TypeForm
represents things that are statically known to be the result of evaluating a type expression, andtype(s)
is itself unambiguously not a type expression. If so, then I think the spec needs to be reworded.Version 1.1.381 from the command line.