Acknowledged
CIQQA-3089

bug: ambiguious and exists in multiple imported modules

import Toybox.Activity;
import Toybox.Lang;
import Toybox.Position;

function onPosition(info as Position.Info) as Void {
    var ai = Activity.getActivityInfo();
}

function initLocationEvents(config as Number) as Void {
    Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, new Lang.Method($, :onPosition) as Method(loc as $.Toybox.Position.Info) as Void);
}

fr955: 'Info' is ambiguious and exists in multiple imported modules [$.Toybox.Position.Info, $.Toybox.Activity.Info].

My code originally was:

Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));

but it doesn't work if onPosition is global. Then it was:

Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, new Method($, :onPosition));

but the strict typechecker doesn't like that, so then it was:

Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, new Method($, :onPositionas Method(loc as Position.Info) as Void);

Which should work, but then new Method only works with -O1 or above (fair enough) so then:

Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, new Lang.Method($, :onPositionas Method(loc as Position.Info) as Void);

Now this should work. However there's still the next BUG in the strict type checker/compiler: this gives the following warning:

fr955: 'Info' is ambiguious and exists in multiple imported modules [$.Toybox.Position.Info, $.Toybox.Activity.Info].

So I said, ok, what not I will do to make the type checker happy?

Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, new Lang.Method($, :onPosition) as Method(loc as $.Toybox.Position.Info) as Void);

However even this gives the same warning. This is clearly a bug in that the type checker throws away the "Position" or whatever is before Info.

Now this is funny, because this should work, period. However this is happening not because my code has another Info class, it's the SDK that has multiple Info classes... so at least the compiler should work with the SDK...