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

Wildcard local variable forward declarations are not recognised #8

Open
Shados opened this issue Feb 4, 2020 · 0 comments
Open

Wildcard local variable forward declarations are not recognised #8

Shados opened this issue Feb 4, 2020 · 0 comments

Comments

@Shados
Copy link

@Shados Shados commented Feb 4, 2020

Moonscript recognises two kinds of wildcarded forward declaration:

  • local ^ to forward declare all uppercase-named variables in the current scope as local
  • local * to forward declare all variables in the current scope as local

moonpick does not appear to handle either of these. An example:

local *

main = ->
  foo!

foo = ->
  nil

main!

Causes:

line 4: accessing global - `foo`
================================
>   foo!

line 6: declared but unused - `foo`
===================================
> foo = ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.