Skip to content

RZ2012: False positive for different Blazor binding syntaxes #10553

@igotinfected

Description

@igotinfected

Ran into two false positives for RZ2012.

Case @bind-Value

Component.razor

[Parameter, EditorRequired]
public bool Value { get; set; }

[Parameter, EditorRequired]
public EventCallback<bool> ValueChanged { get; set; }

Page.razor

<Component @bind-Value="@_value" />

This will trigger the RZ2012 error for ValueChanged.

Case @bind-Value:get & @bind-Value:set

Component.razor

[Parameter, EditorRequired]
public bool Value { get; set; }

[Parameter, EditorRequired]
public EventCallback<bool> ValueChanged { get; set; }

Page.razor

<Component @bind-Value:get="@_value"
           @bind-Value:set="@SetAsync" />

This will trigger the RZ2012 error for both Value and ValueChanged.

Metadata

Metadata

Assignees

Labels

area-compilerUmbrella for all compiler issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions