TysonAndre / phan

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Other
0 stars 0 forks source link

Work on ImmutableUnionType #51

Closed TysonAndre closed 6 years ago

TysonAndre commented 7 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.)

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.