Skip to content

Visual Studio reports API ambiguity #1800

@ScarletKuro

Description

@ScarletKuro

Describe the bug
I noticed that Visual Studio 2026 with ReSharper reports an ambiguity between the following API overloads:

IRenderedComponent<TComponent> Render<TComponent>(Action<ComponentParameterCollectionBuilder<TComponent>>? parameterBuilder = null) where TComponent : IComponent

IRenderedComponent<TComponent> Render<TComponent>(RenderFragment renderFragment) where TComponent : IComponent
Image

While this is a false positive, the project compiles successfully and all tests pass, I would suggest changing the API to the following:

IRenderedComponent<TComponent> Render<TComponent>() where TComponent : IComponent

IRenderedComponent<TComponent> Render<TComponent>(Action<ComponentParameterCollectionBuilder<TComponent>> parameterBuilder) where TComponent : IComponent

IRenderedComponent<TComponent> Render<TComponent>(RenderFragment renderFragment) where TComponent : IComponent

(Remove parameterBuilder = null and add new overload without parameters)
Although it isn’t ABI-compatible, it is source-compatible, so I wouldn’t consider it a breaking change.

Version info:

  • bUnit version 2.4.2:
  • .NET SDK: 10.0.101
  • OS type and version: Windows 10 PRO 19045.6466
  • VS 2026: 18.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions