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

Cannot refer constant from a class #38

Closed
yhara opened this issue Apr 23, 2020 · 1 comment
Closed

Cannot refer constant from a class #38

yhara opened this issue Apr 23, 2020 · 1 comment

Comments

@yhara
Copy link
Collaborator

yhara commented Apr 23, 2020

A = 1
class B
  def foo; A; end
end

Error: Error { msg: "constant `ConstFullname("::A")' was not found", backtrace: stack backtrace:

@yhara yhara added this to the v0.2.4 milestone Apr 23, 2020
@yhara
Copy link
Collaborator Author

yhara commented Apr 23, 2020

Currently A = 1 is inserted into main_exprs and thus cannot be referred from toplevel_defs (eg. class definition).

A should be detected as a constant in prior to convert_toplevel_defs.

@yhara yhara closed this as completed in 023c2c4 Apr 23, 2020
yhara added a commit that referenced this issue Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant