Setting Field declarations to Null

About Monkey 2 Forums Monkey 2 Programming Help Setting Field declarations to Null

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7238

    Arjailer
    Participant

    By habit (years of C#) I set Field declarations to Null, eg:

    But doing this often leads to compile errors like:

    Anyone have any idea why this would be?

    It only affects Field declarations (Local and method parameter declarations seem to be fine being set to Null), and it doesn’t happen every time I add the “= Null“, and if I remove the “= Null” then it works as expected, so it’s not a big deal, but it keeps tripping me up (habits are hard to break) and it seems odd that it would happen.

    #7239

    nerobot
    Participant

    1. Today or yesterday Mark fixed something like that bug. Try to use newest develop sources.

    2. Fields initialized with default values automatically. Not need to write =Null for objects types or =0 for int.

    #7240

    Arjailer
    Participant
    1. I checked the repo before posting and it didn’t look like anything had changed in the last few weeks. I’ll give it a try in the morning though.
    2. Yeah, but it shouldn’t fail if you do   🙂
    #7241

    nerobot
    Participant

    Hm. There is only merged patch in the repository. Then waiting for the guru.

    #7245

    Mark Sibly
    Keymaster

    Fix for this is now up in develop branch.

    You’ll need to updatemx2cc though.

    #7248

    Arjailer
    Participant

    Thanks Mark – works fine now – my ingrained habits can continue  😀

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

You must be logged in to reply to this topic.