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
We have an internal representation (Type::Any) for the dynamic type Any, but we don't yet understand the typing.Any symbol as a spelling for that type in a type expression.
To add this, we'll need to track typing.Any as a KnownInstance (similar to the existing support for typing.Union, typing.Optional, typing.Literal), and add support for it in Type::in_type_expression, so that when TypeInferenceBuilder::infer_type_expression comes across the symbol in an annotation, we understand that annotation as describing the Any type.
We'll want to add mdtests for the "happy path" case like this:
x: Any=1x="foo"deff():
reveal_type(x) # revealed: Any
We'll also want edge-case tests showing that typing.Any can be aliased to a different name, and still works (that is, we are recognizing typing.Any under any name, not just pattern-matching on the local name), and similarly that a locally-defined class named Any simply means its own instance type, not Type::Any, in an annotation.
The text was updated successfully, but these errors were encountered:
We have an internal representation (
Type::Any
) for the dynamic typeAny
, but we don't yet understand thetyping.Any
symbol as a spelling for that type in a type expression.To add this, we'll need to track
typing.Any
as aKnownInstance
(similar to the existing support fortyping.Union
,typing.Optional
,typing.Literal
), and add support for it inType::in_type_expression
, so that whenTypeInferenceBuilder::infer_type_expression
comes across the symbol in an annotation, we understand that annotation as describing theAny
type.We'll want to add mdtests for the "happy path" case like this:
We'll also want edge-case tests showing that
typing.Any
can be aliased to a different name, and still works (that is, we are recognizingtyping.Any
under any name, not just pattern-matching on the local name), and similarly that a locally-defined class namedAny
simply means its own instance type, notType::Any
, in an annotation.The text was updated successfully, but these errors were encountered: