Acknowledged
CIQQA-3111

bug: compiler throws away module from function call + WatchUi has :showToast should be false

import Toybox.Lang;
import Toybox.Graphics;
import Toybox.WatchUi;

function showToast(msg as String or ResourceId, options as { :icon as BitmapResource or BitmapReference or ResourceId } or Null) as Void {
    if (WatchUi has :showToast) {
        WatchUi.showToast(msg, options);
    }
}

Error: Stack Overflow Error Details: Failed invoking <symbol> Stack:
- showToast() at Utils.mc:5 0x10000d92
- showToast() at Utils.mc:7 0x10000db7
...

I know some will tell me I shouldn't use the same function name that already exists, which I might do as a workaround, this still is a huge bug in the compiler.

What's more interesting is that it looks like there's another bug hiding here: vivoactive3 doesn't even have WatchUi.showToast, so the whole block should have been skipped altogether...

SDK 8.1.1, simulator, vivoactive3

Parents
  • Also, I recreated the problem by modifying the Input SDK sample to print the value of "WatchUi has :showToast" to the console and, if true, call WatchUi.showToast()

    But when I create a new device app project from scratch and simply display the value of "WatchUi has :showToast" on the screen, the problem doesn't happen.

Comment
  • Also, I recreated the problem by modifying the Input SDK sample to print the value of "WatchUi has :showToast" to the console and, if true, call WatchUi.showToast()

    But when I create a new device app project from scratch and simply display the value of "WatchUi has :showToast" on the screen, the problem doesn't happen.

Children
No Data