-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-System.Runtime.InteropServices.JavaScriptneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsiderationos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
Description
I believe the regression started from this PR #99924.
The PR introduces a usage of typeof(__GeneratedInitializer), but when you have two assemblies that are using JSExport, then both will generate __GeneratedInitializer class, then typeof(__GeneratedInitializer) is ambiguous.
I guess the __GeneratedInitializer class could be file instead? This should still work with ModuleInitializer. Or maybe generated code could have #pragma warning disable CS0436
Reproduction Steps
It's happening currently in Uno Platform, I haven't tried to make a minimal repro, but I think the description makes it clear on why it happens.
Expected behavior
Things should work as they were in Preview 3
Actual behavior
Build fails with:
/agent/_work/1/s/src/Uno.UI.Dispatching/obj/Uno.UI.Dispatching.Wasm/Release/net9.0/Microsoft.Interop.JavaScript.JSImportGenerator/Microsoft.Interop.JavaScript.JSExportGenerator/JSExports.g.cs(9,328): error CS0436: The type '__GeneratedInitializer' in '/agent/_work/1/s/src/Uno.UI.Dispatching/obj/Uno.UI.Dispatching.Wasm/Release/net9.0/Microsoft.Interop.JavaScript.JSImportGenerator/Microsoft.Interop.JavaScript.JSExportGenerator/JSExports.g.cs' conflicts with the imported type '__GeneratedInitializer' in 'Uno.Foundation.Runtime.WebAssembly, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'. Using the type defined in '/agent/_work/1/s/src/Uno.UI.Dispatching/obj/Uno.UI.Dispatching.Wasm/Release/net9.0/Microsoft.Interop.JavaScript.JSImportGenerator/Microsoft.Interop.JavaScript.JSExportGenerator/JSExports.g.cs'. [/agent/_work/1/s/src/Uno.UI.Dispatching/Uno.UI.Dispatching.Wasm.csproj::TargetFramework=net9.0]
Regression?
Yes. It works in Preview 3 but not Preview 4
Known Workarounds
<PropertyGroup>
<!-- Workaround for https://github.com/dotnet/runtime/issues/103205 -->
<NoWarn>$(NoWarn);CS0436</NoWarn>
</PropertyGroup>Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-System.Runtime.InteropServices.JavaScriptneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsiderationos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm