Acknowledged
CIQQA-3894

bug: documentation of AppBase.onDeviceSettingChanged has code that gives warning

In https://developer.garmin.com/connect-iq/api-docs/Toybox/Application/AppBase.html#onDeviceSettingChanged-instance_function we have this example:

using Toybox.System;

function onDeviceSettingChanged(aSymbol as Symbol, aValue as Object) as Void {
    if (aSymbol == :distanceUnits) {
        var newUnitSystem = aValue as UnitSystem;
        System.println("Distance Units => " + (newUnitSystem == System.UNIT_METRIC ? "Metric" : "Statute"));
    }
}

With strict typecheck this gives the following warning:

The private symbol 'distanceUnits' will not be found when using the indirect lookup syntax ':distanceUnits'. Consider making 'distanceUnits' public / protected or use a direct reference 'self.distanceUnits'.

Which makes me worried, as I am not sure if this is just a stupid warning, that shouldn't be there, or if it has any base, in which case how am I supposed to fix my code to be sure it always works?

Parents
  • Strange. I get a warning, not an error, during the compilation:

    WARNING: enduro3: source/MyView.mc:40,8: The private symbol 'distanceUnits' will not be found when using the indirect lookup syntax ':distanceUnits'. Consider making 'distanceUnits' public / protected or use a direct reference 'self.distanceUnits'.

Comment
  • Strange. I get a warning, not an error, during the compilation:

    WARNING: enduro3: source/MyView.mc:40,8: The private symbol 'distanceUnits' will not be found when using the indirect lookup syntax ':distanceUnits'. Consider making 'distanceUnits' public / protected or use a direct reference 'self.distanceUnits'.

Children
No Data