Error: Missing Return Statements

About Monkey 2 Forums Monkey 2 Programming Help Error: Missing Return Statements

This topic contains 3 replies, has 3 voices, and was last updated by  Arjailer 2 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1475

    jondecker76
    Participant

    What is the proper “monkey2” way of implementing returns?  I’ve noticed that I get the Missing Return Statement error on any method that has conditional returns

    The example below will give the error because of the conditional return:

    Of course, I can make the build process happy if I change it to:

    Is there a better way to to do conditional returns?

    #1477

    Jesse
    Participant

    I think so too.

    you can also implement it like this so it won’t look so bad:

    #1480

    jondecker76
    Participant

    yeah, I thought of that too.  Just kind of goofy.  I’m going to do a bug report on it, as it doesn’t seem quite right!

    #1539

    Arjailer
    Participant

    It’s not right at all – never seen a language do this before, so I’ve got to assume it’s a bug.

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

You must be logged in to reply to this topic.