-
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
component:compilerIssue pertaining to compilerIssue pertaining to compilerissue-type:bugSomething isn't workingSomething isn't working
Description
It is not possible to refer to a class method or static method on a deftype
form right now:
basilisp.user=> (import* abc)
<module 'abc' from '/Users/christopher/.pyenv/versions/3.6.9/lib/python3.6/abc.py'>
basilisp.user=> (def WithStatic
(python/type "WithStatic"
#py (abc/ABC)
#py {"dostatic"
(python/staticmethod
(abc/abstractmethod
(fn [])))}))
#'basilisp.user/WithStatic
basilisp.user=> (deftype* Point [x y z]
:implements [WithStatic]
(^:staticmethod dostatic []))
<class 'basilisp.user.Point'>
basilisp.user=> Point/dostatic
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 3169, in analyze_form
return _analyze_form(ctx, form).assoc(top_level=True)
File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 585, in _analyze_form
return f(ctx, form).fix_missing_locations(form_loc)
File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 3124, in _analyze_form
return _symbol_node(ctx, form)
File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 2933, in _symbol_node
return _resolve_sym(ctx, form)
File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 2911, in _resolve_sym
return __resolve_namespaced_symbol(ctx, form)
File "/Users/christopher/Projects/basilisp/src/basilisp/lang/compiler/analyzer.py", line 2843, in __resolve_namespaced_symbol
f"unable to resolve symbol '{form}' in this context", form=form
basilisp.lang.compiler.exception.CompilerException: unable to resolve symbol 'Point/dostatic' in this context {:phase :analyzing :form Point/dostatic :col 1 :line 1}
Metadata
Metadata
Assignees
Labels
component:compilerIssue pertaining to compilerIssue pertaining to compilerissue-type:bugSomething isn't workingSomething isn't working