New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$tmp_parent_var
pollutes context
#7556
Comments
I found these snippets: https://psalm.dev/r/49d35dd90e<?php
/**
* @method baz(): Foo
*/
class Foo
{
public function __call()
{
return new self();
}
}
class Bar extends Foo
{
public function baz(): Foo
{
parent::baz();
return $tmp_parent_var; // What's this doing here???
}
}
https://psalm.dev/r/e3c3120f6c<?php
/**
* @template T
*/
class Foo
{
public function foobar(): void {}
}
/**
* @template T
* @mixin Foo<T>
*/
class Bar
{
public function baz(): self
{
self::foobar();
return $tmp_mixin_var; // What's this doing here???
}
}
https://psalm.dev/r/65b4820537<?php
/**
* @method static baz(): self
*/
class Foo
{
public static function __callStatic()
{
return new self();
}
}
class Bar extends Foo
{
public static function baz(): Foo
{
return parent::baz();
}
}
|
I'll do that 😉 But for the third error, it's seems that psalm do not support syntax |
I found these snippets: https://psalm.dev/r/8d800f5e5d<?php
/**
* @method static self baz()
*/
class Foo
{
public static function __callStatic()
{
return new self();
}
}
class Bar extends Foo
{
public static function baz(): Foo
{
return parent::baz();
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@vincent4vx re #7414
https://psalm.dev/r/49d35dd90e
Looks like the same applies to
$tmp_mixin_var
, so that can probably be fixed at the same time in the same manner.It would also be a good idea to use
$__tmp_parent_var__
, with underscores like MatchAnalyzer and ArrayMapReturnTypeProvider so that it's less likely to collide with an actual variable.It also doesn't work with static, but that's a separate issue.
The text was updated successfully, but these errors were encountered: