-
Notifications
You must be signed in to change notification settings - Fork 665
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
Incorrectly resolved $this return of PHPDoc defined method in mixin context #3556
Labels
Comments
I found these snippets: https://psalm.dev/r/fc69f45670<?php
/**
* @method $this active()
*/
class A {
public function __call($name, $arguments) {}
}
/**
*
* @mixin A
*/
class B {
}
$b = new B;
/** @psalm-trace $c */
$c = $b->active();
|
SCIF
changed the title
Incorrectly resolved $this in mixin context
Incorrectly resolved $this return of PHPDoc defined method in mixin context
Jun 10, 2020
That affects phpdoc defined methods only: https://psalm.dev/r/1a255b844f |
I found these snippets: https://psalm.dev/r/1a255b844f<?php
/**
* @method $this active()
*/
class A {
public function __call($name, $arguments) {}
/** @return $this */
public function b() {}
}
/**
*
* @mixin A
*/
class B {
}
$b = new B;
/** @psalm-trace $c */
$c = $b->active();
/** @psalm-trace $c */
$c = $b->b();
|
robchett
added a commit
to robchett/psalm
that referenced
this issue
Nov 8, 2023
robchett
added a commit
to robchett/psalm
that referenced
this issue
Nov 8, 2023
Fixed in #10356 . Note that the class importing the mixin should either have it's own |
I found these snippets: https://psalm.dev/r/3d74f0f8cf<?php
/**
* @method $this active()
*/
class A {
public function __call(string $name, array $arguments) {}
}
/**
*
* @mixin A
*/
class B {
}
$b = new B;
$_c = $b->active();
/** @psalm-trace $_c */;
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/fc69f45670
The text was updated successfully, but these errors were encountered: