poor error message with incorrect method return type #46

Closed
opened 2021-10-03 17:15:39 +08:00 by sb10q · 1 comment
@kernel
class Foo:
    @kernel
    def blah(self) -> int32:
        pass


def run() -> int32:
    x = Foo()
    return 0
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "expected return type of class0 in function `__main__Foo.blah`"', nac3standalone/src/main.rs:65:35

class0 does not mean anything to the user.

```python @kernel class Foo: @kernel def blah(self) -> int32: pass def run() -> int32: x = Foo() return 0 ``` ``` thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "expected return type of class0 in function `__main__Foo.blah`"', nac3standalone/src/main.rs:65:35 ``` ``class0`` does not mean anything to the user.
Collaborator

now the error msg looks like:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "expected return type of `int32` in function `__main__A.get_a` at line 13 column 5"', nac3standalone/src/main.rs:65:35
now the error msg looks like: ``` thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "expected return type of `int32` in function `__main__A.get_a` at line 13 column 5"', nac3standalone/src/main.rs:65:35 ```
Sign in to join this conversation.
No Milestone
No Assignees
2 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#46
There is no content yet.