8000 Coconut REPL crashes when importing some functions with mixed typed and untyped arguments. · Issue #667 · evhub/coconut · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Coconut REPL crashes when importing some functions with mixed typed and untyped arguments. #667
Closed
@tom-a-horrocks

Description

@tom-a-horrocks

Steps to reproduce:

  1. Create file my_file.coco containing def fun0(a: str, b) = 'foo'.
  2. Open latest coconut REPL (v1.6.0) and enter import my_file.
  3. Note the REPL crashes with error CoconutSyntaxError: non-default arguments must come first or after star argument/separator.

This is a REPL issue only: coconut my_file.coco compiles and runs without issue. I can't figure out the exact pattern of typed and untyped arguments that cause the crash, but here's all combinations of 2 and 3-arugment functions:

REPL imports without issue
def fun00(a, b) = 'foo'
def fun02(a, b: str) = 'foo'
def fun03(a: str, b: str) = 'foo'
def fun04(a, b, c) = 'foo'
def fun07(a, b, c: str) = 'foo'
def fun10(a, b: str, c: str) = 'foo'
def fun11(a: str, b: str, c: str) = 'foo'

REPL crashes on import
def fun01(a: str, b) = 'foo'
def fun05(a: str, b, c) = 'foo'
def fun06(a, b: str, c) = 'foo'
def fun08(a: str, b: str, c) = 'foo'
def fun09(a: str, b, c: str) = 'foo'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0