Skip to content

Type inconsistency of default values in headers are not pre-checked  #876

@Thizizmyname

Description

@Thizizmyname

Functions or methods with a default value will not type-check the default value in pre-checker, instead an error will only be thrown at the first function call actually utilizing the default value, and the position of the error will be the function call instead of the the declaration.

Is it possible to typecheck pdefault in instance Precheckable ParamDecl where?

Example below

active class Main

    def foo(i1 : int, i2 : int, i3 : int = 5.3) : unit
        ()
    end

    def main() : unit
        this.foo(10, 8)
    end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions