support default values of function arguments #93

Closed
opened 2021-11-11 19:43:30 +08:00 by sb10q · 2 comments
Owner

This program (nac3standalone) should work:

@extern
def output_int(x: int32):
    ...

def foo(x: int32 = 1):
    output_int(x)

def run() -> int32:
    foo()
    return 0

Currently:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Expected more arguments at line 9 column 8"', nac3standalone/src/main.rs:89:35
This program (nac3standalone) should work: ```python @extern def output_int(x: int32): ... def foo(x: int32 = 1): output_int(x) def run() -> int32: foo() return 0 ``` Currently: ``` thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Expected more arguments at line 9 column 8"', nac3standalone/src/main.rs:89:35 ```
Contributor

@ychenfo forgot to handle default values in toplevel/composer.rs.

@ychenfo forgot to handle default values in toplevel/composer.rs.
Contributor

Should we close this as #98 is merged?

Should we close this as #98 is merged?
sb10q closed this issue 2021-12-29 14:33:48 +08:00
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#93
No description provided.