Skip to content

No ad-hoc polymorphism (overloading) for class methods #2207

@quasilyte

Description

@quasilyte

With normal methods:

options gen2

class Example {
    def foo(x : int; y : string) {}

    def foo(x : int) {
        foo(x, "123")
    }
}

[export]
def main() {
}

With abstract method:

options gen2

class Example {
    def abstract foo(x : int; y : string) : void

    def foo(x : int) {
        foo(x, "123")
    }
}

[export]
def main() {
}

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