expressions with functions broken #12

Closed
opened 2021-09-20 12:22:53 +08:00 by sb10q · 2 comments
def foo() -> int32:
    return 41

def run() -> int32:
    return foo() + 1
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', nac3core/src/codegen/expr.rs:256:73
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Got an error: called `Option::unwrap()` on a `None` value
thread 'main' panicked at 'tasks panicked', nac3core/src/codegen/mod.rs:150:13
``` def foo() -> int32: return 41 def run() -> int32: return foo() + 1 ``` ``` thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', nac3core/src/codegen/expr.rs:256:73 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Got an error: called `Option::unwrap()` on a `None` value thread 'main' panicked at 'tasks panicked', nac3core/src/codegen/mod.rs:150:13 ```
Poster
Owner

workaround:

def run() -> int32:
    a = foo()
    return a + 1
workaround: ``` def run() -> int32: a = foo() return a + 1 ```
pca006132 referenced this issue from a commit 2021-09-20 15:51:46 +08:00

Fixed. This is a bug due to how calls are resolved.

Fixed. This is a bug due to how calls are resolved.
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#12
There is no content yet.