Order of initialization bug when using resources at global scope

I ran into a problem tonight where the values in a map weren't getting initialized properly before use. This only seems to affect global variables, and the workaround seems to be pretty trivial. Here is the test case.

using Toybox.Application as App;
using Toybox.System as Sys;

var m = {
"a" => 1,
"b" => Rez.Drawables.id_b,
"c" => "!"
};

var a = [
1,
Rez.Drawables.id_b,
"!"
];

class TestApp extends App.AppBase
{
function onStart() {
var p;

p = m.get("a");
Sys.println(p != null ? "Yay!" : "Bug!");

p = m.get("b");
Sys.println(p != null ? "Yay!" : "Bug!");

p = m.get("c");
Sys.println(p != null ? "Yay!" : "Bug!");

p = a[0];
Sys.println(p != null ? "Yay!" : "Bug!");

p = a[1];
Sys.println(p != null ? "Yay!" : "Bug!");

p = a[2];
Sys.println(p != null ? "Yay!" : "Bug!");
}

function onStop() {

}

function getInitialView() {
return [ new TestView() ];
}
}


When running the program, this is the output that I see...

Yay!
Bug!
Yay!
Yay!
Bug!
Yay!


I can avoid the bug by making a and m static members of a class. I haven't tried making them members of a module, but I'm thinking that would work as well.

Travis