Acknowledged

bug: System.println and static inlined strings in the simulator cause the wrong string to be used

The following code ran on any device with at least CIQ 3.4.0 that supports toasts (i.e: fr955) in the simulator (either 7.4.3 or 8.0.0-Beta) will incorrectly display "other" instead of the expected "toast".

System.println("toast");
if (WatchUi has :showToast) {
    WatchUi.showToast("toast", null);
}
System.println("other");

I'm not 100% sure whether the bug is in println or maybe showToast or how the simulator implements some string functions or if it's a bug in the compiler, but the above few lines clearly reproduce it. I created a new Watch App with the Monkey C extension, and put the above code somewhere.

Note that the text logged is correct, only in the toast it's incorrect.

Parents
  • I see a similar problem in Windows, except instead of displaying a random string literal from the app, the toast displays the "question-mark-in-diamond" character which is displayed when a given character isn't available in the current font. As far as I know, I don't have any strings in my app that consist of a single special character (e.g. non-ASCII).

    The problem follows the same pattern in Windows as it does in Mac:

    - passing a string variable as the first arg to showToast() works

    - passing a string literal, literal resource ID or resource ID variable to showToast() fails

Comment
  • I see a similar problem in Windows, except instead of displaying a random string literal from the app, the toast displays the "question-mark-in-diamond" character which is displayed when a given character isn't available in the current font. As far as I know, I don't have any strings in my app that consist of a single special character (e.g. non-ASCII).

    The problem follows the same pattern in Windows as it does in Mac:

    - passing a string variable as the first arg to showToast() works

    - passing a string literal, literal resource ID or resource ID variable to showToast() fails

Children
No Data