Skip to content

Inconsistent error message for null/nonnull empty dynarrays. #434

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

Open
ske2004 opened this issue Aug 12, 2024 · 0 comments
Open

Inconsistent error message for null/nonnull empty dynarrays. #434

ske2004 opened this issue Aug 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ske2004
Copy link
Contributor

ske2004 commented Aug 12, 2024

type Control = struct {
    things: []int
}

fn main() {
    var x: Control
    // comment and uncomment the line below
    // x.things = {}
    printf("%v", x.things[0])
}

Commented:
Runtime error /playground.um (7): Dynamic array is null
Uncommented:
Runtime error /playground.um (8): Index 0 is out of range 0...-1

@vtereshkov vtereshkov added the enhancement New feature or request label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants