class FooView extends WatchUi.View {
var a as Number = 0;
var s as String = "";
}
typedef IFooView as interface {
var fooView as FooView;
};
class FooApp extends Application.AppBase {
var mainView as IFooView?;
function getInitialView() as [ WatchUi.Views ] or [ WatchUi.Views, WatchUi.InputDelegates ] {
var mainView = new $.FooView();
self.mainView = mainView;
return [mainView];
}
function onStop(state) as Void {
if (mainView != null) {
Application.Properties.setValue("s", mainView.fooView.s); // line 26
Application.Properties.setValue("a", mainView.fooView.a); // line 27
}
}
}
ERROR: fr955: FooApp.mc:27,3: Cannot find symbol ':fooView' on type 'Null'.
For some reason the compiler knows in line 26 that mainView is not null, but forgets it in line 27.
Strict type checker, SDK 8.1.1