Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect handling of default argument values #2509

Closed
@rebcabin

Description

@rebcabin
def main(option: bool = False):
    print("option: ", option)

main()
(lp) ┌─(~/Documents/GitHub/masr/resources/reference)────────────────────────────────────────(brian@MacBook-Pro:s001)─┐
└─(08:43:14 on main ✹ ✭)──> PYTHONPATH=".:../src/runtime/lpython:.." LPYTHON_PY_MOD_NAME="" LPYTHON_PY_MOD_PATH="_lpython-tmp-test-cpython" python ../../../lpython/ISSUES/Issue2509.py
option:  False
(lp) ┌─(~/Documents/GitHub/masr/resources/reference)────────────────────────────────────────(brian@MacBook-Pro:s001)─┐
└─(08:43:40 on main ✹ ✭)──> lpython ../../../lpython/ISSUES/Issue2509.py                          ──(Thu,Feb08)─┘
semantic error: Number of arguments does not match in the function call
 --> ../../../lpython/ISSUES/Issue2509.py:5:1
  |
5 | main()
  | ^^^^^^ (found: '0', expected: '1')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions