eclipse-pdt / pdt

PHP Development Tools project (PDT)
https://eclipse.org/pdt
Eclipse Public License 2.0
188 stars 46 forks source link

Missing error on instantiation on class constant definition #198

Open the-liquid-metal opened 1 year ago

the-liquid-metal commented 1 year ago

Bug Description Missing error on instantiation on class constant definition.

Eclipse environment Version: 2023-06 (4.28.0) Build id: 20230608-1333 PDT: 8.0.0.202306050832

System

To Reproduce Steps to reproduce the behavior: copy-paste this script to the IDE

<?php
declare(strict_types=1);

namespace ns1\ns2;

class Test22 {}

class Test22b {
    public const CONST1 = new Test22;               // this statement must trigger error
    public const CONST2 = [new Test22, new Test22]; // this statement must trigger error
}

trait Test22c {
    public const CONST1 = new Test22;               // this statement must trigger error
    public const CONST2 = [new Test22, new Test22]; // this statement must trigger error
}