@@ -2075,7 +2075,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
20752075 $ nameType = $ this ->getType ($ node ->name );
20762076 if (count ($ nameType ->getConstantStrings ()) > 0 ) {
20772077 return TypeCombinator::union (
2078- ...array_map (fn ($ constantString ) => $ this
2078+ ...array_map (fn ($ constantString ) => $ constantString -> getValue () === '' ? new ErrorType () : $ this
20792079 ->filterByTruthyValue (new BinaryOp \Identical ($ node ->name , new String_ ($ constantString ->getValue ())))
20802080 ->getType (new MethodCall ($ node ->var , new Identifier ($ constantString ->getValue ()), $ node ->args )), $ nameType ->getConstantStrings ()),
20812081 );
@@ -2155,7 +2155,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
21552155 $ nameType = $ this ->getType ($ node ->name );
21562156 if (count ($ nameType ->getConstantStrings ()) > 0 ) {
21572157 return TypeCombinator::union (
2158- ...array_map (fn ($ constantString ) => $ this
2158+ ...array_map (fn ($ constantString ) => $ constantString -> getValue () === '' ? new ErrorType () : $ this
21592159 ->filterByTruthyValue (new BinaryOp \Identical ($ node ->name , new String_ ($ constantString ->getValue ())))
21602160 ->getType (new Expr \StaticCall ($ node ->class , new Identifier ($ constantString ->getValue ()), $ node ->args )), $ nameType ->getConstantStrings ()),
21612161 );
@@ -2197,7 +2197,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
21972197 $ nameType = $ this ->getType ($ node ->name );
21982198 if (count ($ nameType ->getConstantStrings ()) > 0 ) {
21992199 return TypeCombinator::union (
2200- ...array_map (fn ($ constantString ) => $ this
2200+ ...array_map (fn ($ constantString ) => $ constantString -> getValue () === '' ? new ErrorType () : $ this
22012201 ->filterByTruthyValue (new BinaryOp \Identical ($ node ->name , new String_ ($ constantString ->getValue ())))
22022202 ->getType (
22032203 new PropertyFetch ($ node ->var , new Identifier ($ constantString ->getValue ())),
@@ -2271,7 +2271,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
22712271 $ nameType = $ this ->getType ($ node ->name );
22722272 if (count ($ nameType ->getConstantStrings ()) > 0 ) {
22732273 return TypeCombinator::union (
2274- ...array_map (fn ($ constantString ) => $ this
2274+ ...array_map (fn ($ constantString ) => $ constantString -> getValue () === '' ? new ErrorType () : $ this
22752275 ->filterByTruthyValue (new BinaryOp \Identical ($ node ->name , new String_ ($ constantString ->getValue ())))
22762276 ->getType (new Expr \StaticPropertyFetch ($ node ->class , new Node \VarLikeIdentifier ($ constantString ->getValue ()))), $ nameType ->getConstantStrings ()),
22772277 );
@@ -5695,6 +5695,10 @@ private function exactInstantiation(New_ $node, string $className): ?Type
56955695 $ constructorMethod = new DummyConstructorReflection ($ classReflection );
56965696 }
56975697
5698+ if ($ constructorMethod ->getName () === '' ) {
5699+ throw new ShouldNotHappenException ();
5700+ }
5701+
56985702 $ resolvedTypes = [];
56995703 $ methodCall = new Expr \StaticCall (
57005704 new Name ($ resolvedClassName ),
0 commit comments