1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Fix #4509 - treat expression-derived constants as mixed

This commit is contained in:
Matt Brown 2020-11-08 15:36:30 -05:00 committed by Daniil Gentili
parent 51abbc9074
commit fbafb9e97f
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 2 additions and 1 deletions

View File

@ -150,7 +150,7 @@ class ExpressionScanner
}
if (($codebase->register_stub_files || $codebase->register_autoload_files)
&& !\defined($const_name)
&& (!\defined($const_name) || $const_type->isMixed())
) {
$codebase->addGlobalConstantType($const_name, $const_type);
}

View File

@ -510,6 +510,7 @@ class StubTest extends TestCase
$this->addFile(
$file_path,
'<?php
/** @psalm-suppress MixedArgument */
echo CODE_DIR;'
);