Uno: [WASM] Assigning values from static variables in object initializers can cause logic failures

Created on 25 Feb 2020  路  3Comments  路  Source: unoplatform/uno

Current behavior

In WASM, if you use an object initializer to assign a value from a static property to one of the object properties it can cause a preceding 'if' statement to evaluate incorrectly.

Expected behavior

'if' statements should behave predictably.

How to reproduce it (as minimally and precisely as possible)

Launch the attached project in UWP and observe that clicking either button results in a "null tests passed" message. Launch in WASM and observe that clicking the button including object instantiation fails. In the console you can further observe that while string1 and string2 independently evaluate as not being null or empty, if evaluated together they will return that one of them was null or empty.

All logic behaves consistently in the method that does not assign a value from a static property in an object initializer.

App28.zip

Environment

Nuget Package:
Uno.UI
Package Version(s):
2.1.0-dev.1338
Affected platform(s):

  • [ ] iOS
  • [ ] Android
  • [x] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] macOS
  • [ ] Windows
  • [ ] Build tasks
  • [ ] Solution Templates

Visual Studio:

  • [ ] 2017 (version: )
  • [ ] 2019 (version: )
  • [ ] for Mac (version: )

Relevant plugins:

  • [ ] Resharper (version: )

Anything else we need to know?

kinbug

Most helpful comment

Thanks for taking care @jeromelaban. @peternary will look into asap.

All 3 comments

Thank you for the repro case.

From what I can see, this was a linker issue (adding <WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled> fixes the issue), but it has already been fixed in a more recent build of mono.

I'll make an update of the runtime in a bootstrapper update.

Thanks for taking care @jeromelaban. @peternary will look into asap.

Working for me as of latest version!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartinZikmund picture MartinZikmund  路  4Comments

MartinZikmund picture MartinZikmund  路  3Comments

MartinZikmund picture MartinZikmund  路  3Comments

paulovila picture paulovila  路  3Comments

PylotLight picture PylotLight  路  3Comments