(E0) Internal error: Object reference not set to an instance of an object

I am again getting the dreaded ‘Object reference not set to an instance of an object.’ error. I have reduced the test case to the code shown below. If you comment out the do/while loop, then it builds. If you have it in, then you get the E0 error. At this point, the XML files have also been reduced to their respective minimums. I can post them if that helps. There is no other code in the project.

The project is a C# Android (19) project on Visual Studio, beta release 1927.

using java;
using java.io;
using java.util;
using android.app;
using android.content;
using android.os;
using android.media.audiofx;

using sugar;

namespace org.buildtest
{
public class MainActivity : Activity {
public override void onCreate(Bundle savedInstanceState) {
base.onCreate(savedInstanceState);
ContentView = R.layout.main;
}
}

public class RecordAudio : AsyncTask<java.lang.Void, java.lang.Integer, java.lang.Boolean> {

    protected override java.lang.Boolean doInBackground(params java.lang.Void[] arg1) {
        
        do {                // <== If I comment out these three lines, the error goes away
        }                   // <==
        while (false);      // <==

        return true;
    }
}

}

Thanks, logged as bugs://74529

Update: I hit the error again with some other code. It appears that the problem is that the compiler crashes when it hits a

do {
} while()

loop.

It will compile a

while() {
}

without any issues.

THanks. I’ve added a note.

I also discovered this morning that the compiler issues the same (E0) error under the case:

data[i] &= mask;

where data is a byte[] and mask is a byte. It works fine for

data[i] = data[i] & mask;

That may well be dependent upon the surrounding code, but I don’t have time right now to reduce it to a minimum test case.

Do you still see these issues? I lost track of your issue but now I found it again I can’t reproduce this anymre.

bugs://74529 got closed with status cannotrepro.