Skip to content

[Bug]: XAML diagnostics false positives on valid markup #354

Open

Description

Describe the bug

These valid constructs build and run but get diagnostics:

  • Case-variant values (Visibility="collapsed", Mode=oneway) are Errors (WXAML0012/WXAML0022/WXAML0025).
  • WMC1510 Native AOT warning on {Binding} in templates in projects without PublishAot/IsAotCompatible.
  • {x:Bind Ex.Tup.Item2} on a ValueTuple is flagged WXAML0005.
  • ToString(), Equals(), GetHashCode() on class-typed x:Bind receivers are flagged WXAML0011.
  • x:Name values with combining marks or letter-numbers (Café in NFD, aⅣ) are flagged WXAML0014.

To Reproduce

  1. Add any of the snippets above to a page, e.g. <Button Visibility="collapsed"/>, <TextBlock Text="{x:Bind ViewModel.Selected.ToString()}"/>, or a DataTemplate with {Binding Name}.
  2. Observe the diagnostic. dotnet build succeeds.

Expected behavior

No diagnostic for anything the XAML compiler accepts. WMC1510 only appears in AOT or trim-enabled projects.

Notes

Bug bash IDs: C-16, C-37, C-47 (tuple), C-48, C-54.

Screenshots

No response

OS Version and details

Windows 11 x64 (10.0.26200), VS Code 1.143.1, .NET SDK 10.0.403. Found in the XAML IntelliSense bug bash on 0.3.1-prerelease.456 (PR #276, f90df977).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions