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

late modifier #93

Closed
mhbdev opened this issue Nov 28, 2023 · 1 comment
Closed

late modifier #93

mhbdev opened this issue Nov 28, 2023 · 1 comment

Comments

@mhbdev
Copy link

mhbdev commented Nov 28, 2023

Situation

Think of non-null variable that would be set later with different values on different conditions.

Proposal

I think it would be nice if we can define a variable with late modifier.
something like late let test: Int; so we can set its value later.

late let test: Int;

if(condition0) {
    test = 0;
} else {
    test = 1;
}

dump(test.toString());
@anton-trunov anton-trunov changed the title [FEATURE] - late modifier late modifier Nov 28, 2023
@anton-trunov
Copy link
Member

This case can be now resolved using a conditional expression which was implemented in #94. Closing this one now. Feel free to reopen if there is a compelling use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants