Repository navigation
fix(xamlgen): Skip ApiExtension registrations of inaccessible types - #25905
MartinZikmund merged 1 commit into
Conversation
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25905/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
|
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
1cf0df9 to
e67aa80
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25905/docs/index.html |
|
|
|
@Mergifyio backport release/stable/7.0 |
✅ Backports have been createdDetails
|
e67aa80 to
0f335fe
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
0f335fe to
2e9cde5
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25905/docs/index.html |
The app's generated code registers every [assembly: ApiExtension] of its references. A registration naming an internal type failed the app's build with CS0122. It is now skipped with a UXAML0008 warning that points at the declaring assembly. Fixes unoplatform#25010 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2e9cde5 to
09516f2
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25905/docs/index.html |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
GitHub Issue: closes #25010
PR Type:
🐞 Bugfix
What changed? 🚀
The application's generated
Appcode registers the[assembly: ApiExtension]declarations of every referenced assembly (XamlFileGenerator.GenerateApiExtensionRegistrations). It wrote the types straight intotypeof(global::…)/new global::…(o)without checking that the app can see them. A library declaring the attribute oninternaltypes compiled fine, and then every app referencing it failed withCS0122.The generator now checks each type an
ApiExtensionnames (extended, extension and owner) withCompilation.IsSymbolAccessibleWithin(…, Compilation.Assembly). When one isn't accessible, it skips that registration and reports a warning naming the registration, the declaring assembly and the type:Skipping (rather than a reflection-based registration) keeps the existing contract: every
ApiExtensionUno ships names public types (Foldable, GooglePlay, Graphics3DGL, SpellChecking, WebView.X11, Lottie). A reflection path would also leave the extension's constructor exposed to trimming.uno-build-error-codes.mddocuments UXAML0008 and its fix, which is to make the types public in the declaring library.Validation
Given_ApiExtension, with an app that references a second compiled projectLibcarrying the attribute:internaltypes: the app compiles and reports exactly one UXAML0008. With the previous generator this test fails with the issue's errors (CS0122: 'IMyExtension' is inaccessible due to its protection level, same forMyExtension).publictypes: the app compiles with no diagnostics.Uno.UI.SourceGenerators.Testsrun locally: same failure set asmaster(environment-related), plus the two new tests passing.Uno.Sdk.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code