mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix handling of property type with default
This commit is contained in:
parent
4a954acf84
commit
36ac342496
@ -763,7 +763,6 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
|||||||
foreach ($stmt->props as $prop) {
|
foreach ($stmt->props as $prop) {
|
||||||
if ($prop->default) {
|
if ($prop->default) {
|
||||||
$member_stmts[] = $stmt;
|
$member_stmts[] = $stmt;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codebase->alter_code) {
|
if ($codebase->alter_code) {
|
||||||
|
@ -377,6 +377,11 @@ class ClassMoveTest extends \Psalm\Tests\TestCase
|
|||||||
* @param Bat $b
|
* @param Bat $b
|
||||||
*/
|
*/
|
||||||
function doSomething(Bat $b) : void {}
|
function doSomething(Bat $b) : void {}
|
||||||
|
|
||||||
|
class A {
|
||||||
|
/** @var ?Bat */
|
||||||
|
public $x = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
namespace Bar {
|
namespace Bar {
|
||||||
class Bat {
|
class Bat {
|
||||||
@ -393,6 +398,11 @@ class ClassMoveTest extends \Psalm\Tests\TestCase
|
|||||||
* @param Bahh $b
|
* @param Bahh $b
|
||||||
*/
|
*/
|
||||||
function doSomething(Bahh $b) : void {}
|
function doSomething(Bahh $b) : void {}
|
||||||
|
|
||||||
|
class A {
|
||||||
|
/** @var null|Bahh */
|
||||||
|
public $x = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
namespace Bar\Baz {
|
namespace Bar\Baz {
|
||||||
class Bahh {
|
class Bahh {
|
||||||
|
Loading…
Reference in New Issue
Block a user