Wen I set the Type Check Level to strinct then the following code doesn't compile:
if (sensor != null && sensor.data != null) {...}
Type Check Level: strict causes Cannot find symbol ':data' on type 'Null'
How am I supposed to deal with these? Is there a better solution than the too verbose casting:
if (sensor != null && (sensor as Sensor).data != null) {...}
The compiler must be clever enough to figure it out that sensor can't be null there, or at least we should have the ! operator like in kotlin:
if (sensor != null && sensor!.data != null) {...}