With type checking turned on, I am having trouble with this line:
Communications.makeWebRequest(compURL,
{},
{},
method(:onReceiveData)
);
The compiler complains about the callback function parameter as follows:
Invalid '$.Toybox.Lang.Method(responseCode as $.Toybox.Lang.Number, data as $.Toybox.Lang.String) as Void' passed as parameter 4 of type 'PolyType<(callback(responseCode as $.Toybox.Lang.Number, data as Null or $.Toybox.Lang.Dictionary or $.Toybox.Lang.String) as Void) or (callback(responseCode as $.Toybox.Lang.Number, data as Null or $.Toybox.Lang.Dictionary or $.Toybox.Lang.String, context as $.Toybox.Lang.Object) as Void)>'.
The definition of my callback function looks like this:
function onReceiveData(responseCode as Lang.Number, data as Lang.String) as Void {
....
}
Does anyone see what is wrong?