Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Comparing method to int crashes the compiler #202

Open
kflynn opened this issue Jun 27, 2016 · 0 comments
Open

Comparing method to int crashes the compiler #202

kflynn opened this issue Jun 27, 2016 · 0 comments

Comments

@kflynn
Copy link
Contributor

kflynn commented Jun 27, 2016

This bad Quark:

if (args.size > 0) { ... }

(note the lack of parens on size()) produces this crash:

Internal compiler error, Quark 1.0.133 run at 2016-06-27 13:27:10.671644

Traceback (most recent call last):
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/command.py", line 196, in main
    compiler.install(c, url, offline, *backends)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/compiler.py", line 1320, in install
    c.compile()
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/compiler.py", line 1293, in compile
    self.icompile(root)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/compiler.py", line 1214, in icompile
    ast.traverse(res)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 110, in traverse
    c.traverse(visitor, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/ast.py", line 111, in traverse
    leave(self, *args, **kwargs)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/compiler.py", line 639, in leave_Attr
    a.resolved = a.expr.resolved.get(a.attr, self.errors)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/compiler.py", line 367, in get
    for env in self.environments(self.type, bindings):
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/dispatch.py", line 51, in __call__
    method = self.get(types)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/dispatch.py", line 47, in get
    self.dispatcher.error(types)
  File "/Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/dispatch.py", line 76, in error
    (self.name, ", ".join([t.__name__ for t in types])))
TypeError: environments has no matching method: (MethodMacro, dict)


Compiler was looking at:
  /Users/flynn/.quark/venv/lib/python2.7/site-packages/quarkc/lib/primitives.q:351:9 MethodMacro size
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:123:17 Name
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:123:17 Attr
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:123:17 Call
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:123:13 If
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:102:93 Block
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:102:9 Method query
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:52:5 Class Tracer
  /Users/flynn/datawire/mdk/quark/tracing-1.0.q:44:1 Package tracing
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant