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

Closured length as parameter causes error in JS mode #152

Closed
brekk opened this issue Apr 13, 2024 · 1 comment
Closed

Closured length as parameter causes error in JS mode #152

brekk opened this issue Apr 13, 2024 · 1 comment

Comments

@brekk
Copy link
Contributor

brekk commented Apr 13, 2024

If the keyword length is used as a parameter and closured, it causes the compiled code to barf in Node / JS.

Code:

barfOnLength :: Integer -> Integer
export barfOnLength = (length) => length

main = () => {
  barfOnLength(6)
}

Error:

madlib/build/LengthBug.mjs:27
export let _08321_barfOnLength__1 = (length => _$_length_$_);
                                               ^

ReferenceError: _$_length_$_ is not defined

This doesn't seem to fail in LLVM and it doesn't throw an error unless invoked.

@aboeglin
Copy link
Contributor

Closed by #151

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