Skip to content

Class with constructor got issue #119

@huynhphuchuy

Description

@huynhphuchuy

I got error with these lines of code:

class Animal {
    function constructor(breed = "bear") {
        this.breed = breed
    }
    function speak() {
        print(this.breed)
    }
}

animal = Animal.new()
animal.speak()

The detail error is:

panic: interface conversion: ast.ExpressionNode is *ast.Identifier, not *ast.Number

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