Skip to content

fix function return type deduction implementation to conform language-spec #9

@VinaLx-zz

Description

@VinaLx-zz

language spec allow either

define fac(a: Int) =
    if a == 0: return 1
    return fac (a - 1)

or

define fac(a: Int) =
    if a > 0: return fac (a - 1)
    return 1

to successfully deducing fac: Function Int Int since one of the return statement is valid.
But currently implementation forces the return type declaration when function make recursive calls.

Metadata

Metadata

Assignees

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