Closed TysonAndre closed 6 years ago
Use this for internal function signatures, real param types in function/method signatures, and real return types in function/method signatures.
Make sure there is only one instance for any union type (e.g. one for ?int, one for MyClass, one for ` (no type), one forstring|false`, etc.)
?int
MyClass
` (no type), one for
Modifying it should throw an Error (or throw Unanalyzable?)
This would require us to stop using clone
Alternately, add $is_immutable to UnionType
Goals: reduce memory, reduce running time, enforce that types aren't being modified accidentally.
Use this for internal function signatures, real param types in function/method signatures, and real return types in function/method signatures.
Make sure there is only one instance for any union type (e.g. one for
?int
, one forMyClass
, one for` (no type), one for
string|false`, etc.)Modifying it should throw an Error (or throw Unanalyzable?)
This would require us to stop using clone
Alternately, add $is_immutable to UnionType
Goals: reduce memory, reduce running time, enforce that types aren't being modified accidentally.