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

Null conditional bind does nothing #11571

Open
fourst4r opened this issue Feb 10, 2024 · 1 comment
Open

Null conditional bind does nothing #11571

fourst4r opened this issue Feb 10, 2024 · 1 comment

Comments

@fourst4r
Copy link
Contributor

function main() {
    var p:Null<()->String> = () -> "ok";
    trace(p?.bind()());
}

https://try.haxe.org/#070F275b

Looking at the generated js you can see that no null check gets inserted for a ?.bind operation.

@Simn
Copy link
Member

Simn commented Feb 10, 2024

Oh so that's what these efk_todo in typer.ml are about...

@fourst4r fourst4r changed the title Null coalescing bind does nothing Null conditional bind does nothing Feb 25, 2024
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

No branches or pull requests

2 participants