Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 196acb37f640
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 73a8f3c442dc
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 2, 2015

  1. Improve builtin call error message.

    whitequark committed Jul 2, 2015
    Copy the full SHA
    8a65266 View commit details
  2. Fix tests.

    whitequark committed Jul 2, 2015
    Copy the full SHA
    73a8f3c View commit details
Showing with 7 additions and 3 deletions.
  1. +1 −1 artiq/compiler/testbench/inferencer.py
  2. +6 −2 artiq/compiler/transforms/inferencer.py
2 changes: 1 addition & 1 deletion artiq/compiler/testbench/inferencer.py
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ def process_diagnostic(diag):
buf = source.Buffer("".join(fileinput.input()).expandtabs(),
os.path.basename(fileinput.filename()))
parsed, comments = parse_buffer(buf, engine=engine)
typed = ASTTypedRewriter(globals=prelude.globals(), engine=engine).visit(parsed)
typed = ASTTypedRewriter(engine=engine).visit(parsed)
Inferencer(engine=engine).visit(typed)

printer = Printer(buf)
8 changes: 6 additions & 2 deletions artiq/compiler/transforms/inferencer.py
Original file line number Diff line number Diff line change
@@ -374,9 +374,13 @@ def valid_form(signature):
node.func.loc)

def diagnose(valid_forms):
printer = types.TypePrinter()
args = [printer.name(arg.type) for arg in node.args]
args += ["%s=%s" % (kw.arg, printer.name(kw.value.type)) for kw in node.keywords]

diag = diagnostic.Diagnostic("error",
"{func} cannot be invoked with these arguments",
{"func": typ.name},
"{func} cannot be invoked with the arguments ({args})",
{"func": typ.name, "args": ", ".join(args)},
node.func.loc, notes=valid_forms)
self.engine.process(diag)