Acknowledged
CIQQA-3455

Linter expects a Number (only) as argument for the Dict.hasKey() method for -l1 and above

Looks like I can't post code, nor images, nor anything. So you will have to live with my description:
When retrieving a dictionary from the storage:
var foo = Toybox.Application.Storage.getValue("foo")
and using
foo.hasKey("bar")
on said dictionary, the linter expects a number only as argument and the code fails to compile.
Error message:
Invalid '$.Toybox.Lang.String' passed as parameter 1 of type '$.Toybox.Lang.Number'.
Parents
  • I do agree that the error doesn't make any sense, and it's not the first time that the default type-check level (-l 1) is materially worse than the higher type check levels. (Yeah I know it's on purpose.)

    In a perfect world, -l 2 would be the default.

Comment
  • I do agree that the error doesn't make any sense, and it's not the first time that the default type-check level (-l 1) is materially worse than the higher type check levels. (Yeah I know it's on purpose.)

    In a perfect world, -l 2 would be the default.

Children
No Data