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

Making uniontype immutable (experimental) #126

Closed TysonAndre closed 6 years ago

TysonAndre commented 6 years ago

This reduces memory usage somewhat and makes functions accepting UnionType easier to reason about.

TysonAndre commented 6 years ago

Things to try:

TysonAndre commented 6 years ago

Seeing a new bug with this example:

<?php

class Common{
    const TYPE_INT = 'i';
}

class CC extends Common {
    protected static $mappings = [
        'key' => ['name' => 'name', 'type' => self::TYPE_INT],
    ];
}
src/union_type.php:9 PhanUndeclaredConstant Reference to undeclared constant \CC::TYPE_INT