3dfee274cc
Currently the type of a static field is only based on the dart type, not inferred types. This can mean that the type of such field is e.g. `dynamic`. Though the return type of the initializer function used the unboxing information. => There was an invariant that if we use `null` to signal uninitialized in the global, then calling the initializer will also result in a non-nullable reference type. => This was invariant was broken by recent changes to dart2wasm that take advantage of TFA-inferred unboxing information. => We fix this inconsistency by ensuring the wasm global's type is the same as the initializer function's return type. Change-Id: I9c27c0b28d2f81f888b4c9afc59dad42af2229ab Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365825 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>