You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an imported type in @psalm-assert-if-true a third-party consumer doesn't get the type correctly and I can't reproduce it in the sandbox or in separate files.
Please ignore the deluge of errors, it's a refactor in progress... The relevant traces and errors are below:
ERROR: Trace - src/Parser/TracePlugin.php:100:13 - $trace: list<type-alias(Kint\Zval\TraceFrameValue::TraceFrame)> (see https://psalm.dev/224)
/**
* @psalm-trace $trace
* @psalm-trace $index
* @psalm-trace $trace[$index]
*/
if (!isset($trace[$index]['file'])) {
continue;
}
ERROR: Trace - src/Parser/TracePlugin.php:100:13 - $index: int|string (see https://psalm.dev/224)
/**
* @psalm-trace $trace
* @psalm-trace $index
* @psalm-trace $trace[$index]
*/
if (!isset($trace[$index]['file'])) {
continue;
}
ERROR: Trace - src/Parser/TracePlugin.php:100:13 - $trace[$index]: mixed (see https://psalm.dev/224)
/**
* @psalm-trace $trace
* @psalm-trace $index
* @psalm-trace $trace[$index]
*/
if (!isset($trace[$index]['file'])) {
continue;
}
ERROR: InvalidArrayAccess - src/Parser/TracePlugin.php:100:24 - Cannot access array value on non-array variable $trace[$index] of type type-alias(Kint\Zval\TraceFrameValue::TraceFrame) (see https://psalm.dev/005)
if (!isset($trace[$index]['file'])) {
Even if $trace[$index] is a non-existent index (Which should be a different error) it should be null|TraceFrame not mixed as in the trace, and the actual error doesn't recognise that the type-alias(...) is an array
The text was updated successfully, but these errors were encountered:
When using an imported type in
@psalm-assert-if-true
a third-party consumer doesn't get the type correctly and I can't reproduce it in the sandbox or in separate files.The type
TraceFrame
is defined as:And imported and used in:
Then when this is used in another piece of code the type is traced as
list<type-alias(Kint\Zval\TraceFrameValue::TraceFrame)>
and causes errors.The full code can be viewed in jnvsor/kint@5f5e69d
Please ignore the deluge of errors, it's a refactor in progress... The relevant traces and errors are below:
Even if
$trace[$index]
is a non-existent index (Which should be a different error) it should benull|TraceFrame
notmixed
as in the trace, and the actual error doesn't recognise that thetype-alias(...)
is an arrayThe text was updated successfully, but these errors were encountered: