Skip to content

Uninitialized array method call should throw expection. Access to uninitialized properties should be compile error/warning. #899

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

Closed
vird opened this issue Oct 11, 2019 · 0 comments · Fixed by #2578
Assignees
Labels

Comments

@vird
Copy link

vird commented Oct 11, 2019

Slightly related to #482

export function main(): i32 {
  let res = 0;
  let arr:i32[];// initialized with garbage
  
  for(let i=0;i<10;i++) {
    arr.push(i);
  }
  
  return res;
}

This code throws exception on third iteration

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

Successfully merging a pull request may close this issue.

3 participants