Skip to content

Frog allows dynamically adding methods to lists #1054

Closed
@kasperl

Description

@kasperl

The following code is not supposed to work, but the Frog compiler allows it and happily prints "hest". The A class is just there to silence a warning about bar() not being defined anywhere:

  class A {
    bar() { }
  }

  main() {
    var a = [];
    a["proto"]["bar$0"] = () { print('hest'); };
    a.bar();
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions