Under Review
over 1 year ago

Bug report: Wrong type checking errors in static methods in 4.1.7

Since Connect IQ 4.1.7 I get a lot of type errors which wasn't there in 4.1.6, and which don't make sense like:

Cannot find symbol ':toLower' on type '$.Toybox.Lang.String'

in this code:

public static function getMaxSpeedByName (name as Lang.String) as Lang.Float {
    var lowerCaseName = name.toLower(); // Cannot find symbol ':toLower' on type '$.Toybox.Lang.String'.

or

Cannot find symbol ':size' on type '$.Toybox.Lang.ByteArray'.

in this code:

public static function getUInt24 (data as Lang.ByteArray, offset as Lang.Number) as Lang.Number {
  if (data.size() < offset + 3) { // Cannot find symbol ':size' on type '$.Toybox.Lang.ByteArray'.
    return 0;
  }

They all appear in public static methods.

As said before, the same code has been compiled with the same options, without problem in Connect IQ 4.1.6 (with --typecheck 3).