Acknowledged

Bug: Weird warning when adding a Layer

Reference thread:

https://forums.garmin.com/developer/connect-iq/f/discussion/301701/struggling-a-bit-with-views-and-how-stuff-gets-on-the-screen/1460947#1460947

// lines 106-110 in source/AnimationWatchFaceView.mc

        _drawLayer = new WatchUi.Layer({
            :locX=>_drawLayerArea[0],
            :locY=>_drawLayerArea[1],
            :width=>_drawLayerArea[2],
            :height=>_drawLayerArea[3]});
            
// My code
    var layer = new Ui.Layer({
      :locX       => 140,
      :locY       => 140,
      :width      => 140,
      :height     => 140,
      :visibility => true,
    });

The code emits a warning:

WARNING: fenix6xpro: /home/ciq/src/source/views/OverlayView.mc:30: Unable to detect scope for the symbol reference 'width'.
WARNING: fenix6xpro: /home/ciq/src/source/views/OverlayView.mc:30: Unable to detect scope for the symbol reference 'height'.

Funny enough it does seem to work as advertised, because I can set the height and width correctly.


Full code is available at https://gitlab.com/waterkip/ciq-demo-watch-app/-/blob/overlay-view/source/views/OverlayView.mc

Parents
  • And you don’t set a comma after the last parameter visibility.

    If it's not a syntax error, why does it matter? Javascript allows trailing commas in object literals, array literals, and even function parameters (although JSON does not).

    If you think that's bad language design, seems like that's a Connect IQ bug, not an issue with anybody's code.

Comment
  • And you don’t set a comma after the last parameter visibility.

    If it's not a syntax error, why does it matter? Javascript allows trailing commas in object literals, array literals, and even function parameters (although JSON does not).

    If you think that's bad language design, seems like that's a Connect IQ bug, not an issue with anybody's code.

Children
No Data