Repository navigation
Description
Current behavior 🐛
CI builds (and local master builds) fail to compile Uno.UI for the Skia and Reference net10.0 targets with CS0136:
src/Uno.UI/UI/Xaml/ResourceDictionary.cs(591,58): error CS0136: A local or parameter named 'materializedProvider' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter [Uno.UI.Skia.csproj::TargetFramework=net10.0]
src/Uno.UI/UI/Xaml/ResourceDictionary.cs(591,58): error CS0136: A local or parameter named 'materializedProvider' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter [Uno.UI.Reference.csproj::TargetFramework=net10.0]
This is a merge-time regression, not a defect in either change on its own. Two independently-merged PRs each introduced a pattern variable named materializedProvider in ResourceDictionary.GetValueWithKeyOverride (or its lazy-materialization helper):
fix(theming): resolve binding & resource ThemeResource against owner theme(commit84a8eadd1f) addedif (value is IDependencyObjectStoreProvider materializedProvider ...)in the enclosing block scope, after thetry/finally.fix(alc): resources must not inherit DataContext from their host subtree(commit58a07c27d2) addedelse if (newValue is IDependencyObjectStoreProvider materializedProvider)inside the nestedfinallyblock.
A pattern variable in the enclosing block has scope spanning the rest of that block, so the inner-scope (finally) declaration collides with it — even though it appears textually earlier. Each branch built cleanly in isolation; the conflict only surfaces once both are on master.
Expected behavior 🎯
Uno.UI compiles cleanly for all targets; CI is green.
How to reproduce it (as minimally and precisely as possible) 🔬
- Check out
master(after both commits above were merged). - Build the Skia or Reference target of
Uno.UI, e.g.dotnet build src/Uno.UI-Skia-only.slnf. - Compilation fails with the CS0136 errors above.
No app repro is required — this is a build break in the Uno source tree itself.
Workaround 🛠️
Rename one of the two materializedProvider pattern variables so the inner-scope and enclosing-scope names no longer collide (e.g. rename the finally-block occurrence to storeProvider). Both are independent casts to IDependencyObjectStoreProvider of different values (newValue vs value), so the rename is purely a scoping fix with no behavioral change.
Renderer 🎨
- Skia
Affected platforms 📱💻🖥️
- Build tasks (all Skia + Reference
net10.0consumers)
Anything else we need to know? 💬
Pure internal build break — affects contributors building from source / CI, not published packages. Fix PR incoming.
Activity