File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed
Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -762,6 +762,10 @@ public function toNumber(): Type
762762 ]);
763763 }
764764
765+ if ($ this ->isInstanceOf ('BcMath\Number ' )->yes ()) {
766+ return $ this ;
767+ }
768+
765769 return new ErrorType ();
766770 }
767771
Original file line number Diff line number Diff line change @@ -408,8 +408,8 @@ public function bcVsNever(Number $a): void
408408
409409 public function bcUnaryOp (Number $ a ): void
410410 {
411- assertType ('*ERROR* ' , +$ a );
412- assertType ('*ERROR* ' , -$ a );
411+ assertType ('BcMath\Number ' , +$ a );
412+ assertType ('BcMath\Number ' , -$ a );
413413 assertType ('*ERROR* ' , ~$ a );
414414 }
415415
Original file line number Diff line number Diff line change @@ -173,14 +173,6 @@ public function testUnion(): void
173173 public function testBcMathNumber (): void
174174 {
175175 $ this ->analyse ([__DIR__ . '/data/unary-bcmath-number.php ' ], [
176- [
177- 'Unary operation "+" on BcMath\Number results in an error. ' ,
178- 9 ,
179- ],
180- [
181- 'Unary operation "-" on BcMath\Number results in an error. ' ,
182- 10 ,
183- ],
184176 [
185177 'Unary operation "~" on BcMath\Number results in an error. ' ,
186178 11 ,
You can’t perform that action at this time.
0 commit comments