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

Requires don't resolve if they are not top-level #545

Open
chrisrink10 opened this issue May 17, 2020 · 1 comment
Open

Requires don't resolve if they are not top-level #545

chrisrink10 opened this issue May 17, 2020 · 1 comment
Labels
component:compiler Issue pertaining to compiler issue-type:bug Something isn't working

Comments

@chrisrink10
Copy link
Member

Required names and aliases do not resolve if they are not first imported top-level:

basilisp.user=> (do (require '[clojure.set :as set]) set/union)
Traceback (most recent call last):
  File "/Users/christopher/Projects/basilisp/src/basilisp/cli.py", line 139, in repl
    result = eval_str(lsrc, ctx, ns, eof)
  File "/Users/christopher/Projects/basilisp/src/basilisp/cli.py", line 51, in eval_str
    last = compiler.compile_and_exec_form(form, ctx, ns)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/__init__.py", line 133, in compile_and_exec_form
    lisp_ast = analyze_form(ctx.analyzer_context, form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 3253, in analyze_form
    return _analyze_form(ctx, form).assoc(top_level=True)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 636, in _analyze_form
    return f(ctx, form).fix_missing_locations(form_loc)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 3194, in _analyze_form
    return _list_node(ctx, form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 2737, in _list_node
    return handle_special_form(ctx, form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 1661, in _do_ast
    statements, ret = _body_ast(ctx, form.rest)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 669, in _body_ast
    body_expr = _analyze_form(ctx, ret_form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 636, in _analyze_form
    return f(ctx, form).fix_missing_locations(form_loc)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 3208, in _analyze_form
    return _symbol_node(ctx, form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 3017, in _symbol_node
    return _resolve_sym(ctx, form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 2995, in _resolve_sym
    return __resolve_namespaced_symbol(ctx, form)
  File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 2911, in __resolve_namespaced_symbol
    form=form,
basilisp.lang.compiler.exception.CompilerException: unable to resolve static or class member 'set/union' in this context {:phase :analyzing :line 1 :form set/union :col 38}

Related to #544

@chrisrink10
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:compiler Issue pertaining to compiler issue-type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant