Lambdas Silently Ignore Default Arguments

About Monkey 2 Forums Monkey 2 Development Lambdas Silently Ignore Default Arguments

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  ImmutableOctet 2 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4388

    ImmutableOctet
    Participant

    Lambda expressions don’t seem to work properly with default arguments. They’re treated as if they weren’t assigned. This would be fine if it’s the intended behavior, but an error message is not provided. Assuming default arguments are intended to work, then this is a bug, rather than a missing error.

    Testing was performed with mx2cc version 1.0.7.

    Example:

    Presuming the rules for lambdas are the same as functions, this should output “Hello world.” 200 times, then output “Done.”.

    MX2CC currently produces an error claiming that no arguments were given, ignoring the default assignment, for better or worse.

    monkey2/tmp/untitled1.monkey2 [7] : Error : Wrong number of arguments – expecting 1 not 0

    #4393

    Mark Sibly
    Keymaster

    Can you post this to github issues, so it doesn’t get ‘lost’?

    #4403

    ImmutableOctet
    Participant

    Started an issue. I presume GitHub’s the correct place to post bugs, then? I originally intended to post to GitHub, but I didn’t know if this was intended behavior or not.

    #4410

    Mark Sibly
    Keymaster

    I presume GitHub’s the correct place to post bugs, then?

    Yes, I’ve grown to like it a lot compared to my old ‘bug reports’ forum approach.

    I didn’t know if this was intended behavior or not.

    When in doubt, post, I can always just chuck it later.

    #4421

    ImmutableOctet
    Participant

    I’m really glad you’re adopting GitHub as a part of bug tracking and discussion.

    Just for the record, you know the creator of a repository can also open issues, right? In other words, if you end up finding a bug you want to fix later, you can add and document it.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.