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
$this
type inside object creation
#2620
$this
type inside object creation
#2620
Conversation
Seems to work inside btw. on that class this is not the last issue - it's a good implicit test case 😉 |
@@ -34,6 +34,29 @@ public function hello() | |||
$this->assertEquals(false, $frame->locals()->byName('this')->first()->isProperty()); | |||
}]; | |||
|
|||
yield 'It returns this with correct type' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... in an anonymous function
$this
type inside object creation
is this a regression or has it never worked? |
This is a regression fix. Before adding |
In which MR was the regression introduced? |
It's a regression, as I mentioned in #2618 (comment) (this PR should contain |
Thank you |
That's an easy fix. If we're inside an
ObjectCreationExpression
and it has a name, then just continue looking up the tree.