poor error message when host attributes have incorrect type #116

Closed
opened 2021-11-28 12:09:51 +08:00 by sb10q · 1 comment
Owner
from numpy import int32, int64
from min_artiq import *

@nac3
class Demo:
    core: KernelInvariant[Core]
    y: Kernel[int32]

    def __init__(self):
        self.core = Core()
        self.y = int64(0)

    @kernel
    def run(self):
        pass


if __name__ == "__main__":
    Demo().run()
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: "unknown identifier base (use before def?) at line 2 column 5"

(Same as #90, but in #90 we probably want to accept np.float64)

```python from numpy import int32, int64 from min_artiq import * @nac3 class Demo: core: KernelInvariant[Core] y: Kernel[int32] def __init__(self): self.core = Core() self.y = int64(0) @kernel def run(self): pass if __name__ == "__main__": Demo().run() ``` ``` pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: "unknown identifier base (use before def?) at line 2 column 5" ``` (Same as https://git.m-labs.hk/M-Labs/nac3/issues/90, but in #90 we probably want to accept ``np.float64``)
sb10q added the
high-priority
label 2021-12-13 19:22:08 +08:00
ychenfo was assigned by sb10q 2021-12-21 18:48:52 +08:00
Author
Owner

OK, much better:

RuntimeError: type error of object launching kernel: error when getting type of field `y` (Cannot unify int64 with int32)
OK, much better: ``` RuntimeError: type error of object launching kernel: error when getting type of field `y` (Cannot unify int64 with int32) ```
sb10q closed this issue 2022-01-14 16:54:29 +08:00
Sign in to join this conversation.
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#116
No description provided.