-
Notifications
You must be signed in to change notification settings - Fork 1
BUGFIX: Ternary with nested variable access in condition #10
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
BUGFIX: Ternary with nested variable access in condition #10
Conversation
|
Nope should work out of the box ^^ |
I have the feeling it's the right way. It just fell like this into place. Cant 100% explain why but after debugging it i think it is right.
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.
Hi @mhsdesign,
thanks for fixing this!
I saw that php-stan was complaining about the missing return type of ternaryOperationWithVariablesInConditionExamples. So I took the liberty of adding it. Along the way I also added two more examples to the data provider to stress-test the solution. Works superbly! 👍
|
|
||
| /** | ||
| * @dataProvider ternaryOperationExamples | ||
| * @dataProvider ternaryOperationWithVariablesInConditionExamples |
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.
TIL :) I did not know this was possible :D
|
Yeah... I ran the wrong tests... I'm an idiot 😅 Will fix in main soon |
previously:
true === someStruct.foo ? "a" : "foo"is not correctly transpiled. (Its valid ecmascript see the ast that should be build: https://astexplorer.net)i looked now a long time at this code, and still dont know if this is the right solution or if we need to fix the precedence of something ...