Skip to content
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

Fix ?? inference and precedence #11252

Merged
merged 1 commit into from
Jun 13, 2023
Merged

Conversation

RblSb
Copy link
Member

@RblSb RblSb commented Jun 12, 2023

Closes #11197
Closes #11239

Btw, this case fails for both if and null coal usages:

var b:Null<B> = cast null;
var c:C = cast null;
var a = if (b != null) b else c; // C should be Null<B>
var a = b ?? c;

@Simn
Copy link
Member

Simn commented Jun 12, 2023

I'm still not sure about this, something seems wrong with this precedence change, but I don't know what. Maybe it's just another situation where being pragmatic is the right choice.

@RblSb
Copy link
Member Author

RblSb commented Jun 12, 2023

Other langs stats: tc39/proposal-nullish-coalescing#26 (comment)

@Simn
Copy link
Member

Simn commented Jun 12, 2023

Well, if there's no consensus anyway, I agree we can do our own thing for sure!

@Simn Simn merged commit 175c1ca into HaxeFoundation:development Jun 13, 2023
@RblSb RblSb deleted the nullcoal_fix branch June 13, 2023 13:27
@skial skial mentioned this pull request Jun 14, 2023
1 task
kLabz pushed a commit to kLabz/haxe that referenced this pull request Jul 10, 2023
@RblSb RblSb mentioned this pull request Sep 1, 2023
13 tasks
kLabz pushed a commit that referenced this pull request Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

?? precedence ?? operator not equivalent to if
2 participants