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

Type tracking array elements #1

Open
Bablakeluke opened this issue Nov 13, 2016 · 0 comments
Open

Type tracking array elements #1

Bablakeluke opened this issue Nov 13, 2016 · 0 comments
Assignees

Comments

@Bablakeluke
Copy link
Owner

Whilst Nitrassic is generally good at tracking types, it currently struggles with arrays primarily due to this use case:

`
var arr=[]; // Must know it's an array of numbers

function pusher(a){
a.push(1);
}

pusher(arr);
`

The information that the array contains numbers needs to backtrack out of the function. Backtracking type information is required in a few other instances too and it does appear that a general purpose solution is possible.

Asm.js emits the above form of code regularly, so it's important that it is supported. At the moment it will compile, but attempting to manipulate the array afterwards will result in exceptions as most dynamic resolving is currently disabled (in order to make sure types are preserved as often as is possible).

@Bablakeluke Bablakeluke self-assigned this Nov 13, 2016
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

1 participant