This one had me scratching my head for a while…
Working with Android LocationServices I was initialising a LocationRequest using an initialized property and an extended constructor:
Foo = class private property Request := new LocationRequest( Interval := 5000 ); end;
This isn’t the complete initialization, but shows what I was doing. But my instance of Foo would have a nil Request !
Moving the code to a constructor or similar method, rather than an initialized property, I would then get a strange build error:
Uncaught translation error: com.android.dx.cf.code.SimException mismatched stack depths
There is no problem as such however, rather I think the LocationRequest class has some idiosyncrasies which are catching the compiler out in some way ?
Specifically it does not have a ctor, but rather a public static create() method. I have not had any trouble with other Java/Android classes and extended constructors until this one.
I’m not sure whether an extended constructor could/should work in a case such as this or whether the compiler should treat an attempt to use one here as an error ? Just thought I’d mention it.