Skip to content

Compiler crashes when setter/getter is called #2

Description

@keigoi

The following code crashes the ocamljs compiler:

let f o = o#_get_x 1

it says:

Fatal error: exception Failure("bad method call")

while the following equivalent code compiles without crash:

let f o = let g = o#_get_x in g 1

It seems that the getter must not be applied directly to any argument, or ocamljs will die.
Although it is not fatal since there's workaround, it might be better if a more informative message is provided.

Similarly, the following code, which misses the setter's argument, will crash:

let f o = o#_set_x

The error message is the same:
Fatal error: exception Failure("bad method call")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions