mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #3711 - generalize call of specialized class without specializations
This commit is contained in:
parent
ab29ac0e51
commit
e56483bb54
@ -344,7 +344,7 @@ class Taint
|
||||
$generated_sources[] = $generated_source;
|
||||
} elseif (isset($this->specializations[$source->id])) {
|
||||
foreach ($this->specializations[$source->id] as $specialization => $_) {
|
||||
if (isset($source->specialized_calls[$specialization])) {
|
||||
if (!$source->specialized_calls || isset($source->specialized_calls[$specialization])) {
|
||||
$new_source = clone $source;
|
||||
|
||||
$new_source->id = $source->id . '-' . $specialization;
|
||||
|
@ -1411,6 +1411,18 @@ class TaintTest extends TestCase
|
||||
}',
|
||||
'error_message' => 'TaintedInput',
|
||||
],
|
||||
'taintSpecializedMethod' => [
|
||||
'<?php
|
||||
/** @psalm-taint-specialize */
|
||||
class Unsafe {
|
||||
public function isUnsafe() {
|
||||
return $_GET["unsafe"];
|
||||
}
|
||||
}
|
||||
$a = new Unsafe();
|
||||
echo $a->isUnsafe();',
|
||||
'error_message' => 'TaintedInput',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user