Fix error message of too many args #209

Merged
sb10q merged 1 commits from too_many_args_msg_fix into master 2022-03-05 10:17:42 +08:00
Collaborator

I encounter the issue when testing unsigned integers support.

from min_artiq import *
from numpy import int32

@kernel
def fun(a: int32, b: int32, c: int32) -> int32:
    return a + b + c

@nac3
class Demo:
    core: KernelInvariant[Core]
    def __init__(self):
        self.core = Core()

    @kernel
    def run(self):
        fun(3, 5, 4, 5, 5)

if __name__ == "__main__":
    Demo().run()

the error message currently gives incorrect number of given arguments:

nac3artiq.CompileError: compilation failed
----------
Too many arguments. Expected 3 but got 3 at /home/cresc/code/nac3/work1/nac3/my_expr/artiq/too_many_args.py: line 16 column 12

this PR should fix that.

I encounter the issue when testing unsigned integers support. ```python from min_artiq import * from numpy import int32 @kernel def fun(a: int32, b: int32, c: int32) -> int32: return a + b + c @nac3 class Demo: core: KernelInvariant[Core] def __init__(self): self.core = Core() @kernel def run(self): fun(3, 5, 4, 5, 5) if __name__ == "__main__": Demo().run() ``` the error message currently gives incorrect number of given arguments: ```compiler.compile_method_to_file(obj, name, args, "module.elf", embedding) nac3artiq.CompileError: compilation failed ---------- Too many arguments. Expected 3 but got 3 at /home/cresc/code/nac3/work1/nac3/my_expr/artiq/too_many_args.py: line 16 column 12 ``` this PR should fix that.
ychenfo added 1 commit 2022-03-05 04:04:39 +08:00
sb10q merged commit 42fbe8e383 into master 2022-03-05 10:17:42 +08:00
sb10q deleted branch too_many_args_msg_fix 2022-03-05 10:17:42 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#209
No description provided.