Skip to content

Commit

Permalink
Real fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Dec 25, 2022
1 parent ebd5727 commit a8ef02d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static function create(
?string $text = null,
bool $from_docblock = false
): Atomic {
$result = self::createInner($value, $analysis_php_version_id, $template_type_map, $type_aliases);
$result = self::createInner($value, $analysis_php_version_id, $template_type_map, $type_aliases, $from_docblock);
$result->offset_start = $offset_start;
$result->offset_end = $offset_end;
$result->text = $text;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/MutableUnion.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function setTypes(array $types): self
$this->typed_class_strings = [];
$this->checked = false;

$from_docblock = $this->from_docblock;
$from_docblock = false;
$keyed_types = [];

foreach ($types as $type) {
Expand Down
2 changes: 1 addition & 1 deletion tests/TypeReconciliation/RedundantConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ function takesA(A $a): void {}
/** @psalm-suppress PossiblyNullArgument */
takesA($a);
if ($a instanceof A) {}',
'error_message' => 'RedundantConditionGivenDocblockType - src' . DIRECTORY_SEPARATOR . 'somefile.php:15',
'error_message' => 'RedundantCondition - src' . DIRECTORY_SEPARATOR . 'somefile.php:15',
],
'replaceFalseType' => [
'code' => '<?php
Expand Down

0 comments on commit a8ef02d

Please sign in to comment.