dotnet / dotnet/roslyn

Blazor cascading type parameter

Open
#85,660 3 comments 1 reaction 0 assignees View on GitHub
Area-Razor Area-Razor-Compiler untriaged
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I am trying to use cascading type parameters in a situation with an method group using the type param being passed to the component: [https://lab.razor.fyi/](https://lab.razor.fyi/#VVDNSsNAECYionMS6wMMOSUXi2e3IdKbJ6F7aim4Scaw0uxuNxuxhlx9Dd_Cx_HoE3gtSNNF2MswM8z3N7CFCafWzXVjtCLlbqx41_ZqmbudISOsaJAD5KWuCHtARFw9HrbkyK7H2XTFRpZoadtJSxXel05qxXjmO-yxJneH7aEMMMACJnPRlqKSquY7Q16S5cI5K4vOEa6Cg3_BRImG9HPC03QNEFj8jOA6CHLraT8iFpAhn8W6eKHSxdnonwUwb3oWL0RjNhTjNAM2DRiy8B8-_6uWFR5ByZEfdYo9jDcDDPnJwxlZq227vDj__vr53deXp0_RW_QH)

The same works using a lamda expression instead of the method group: [https://lab.razor.fyi/](https://lab.razor.fyi/#VVC9SsRAECZqoVOJ5wMMqZLGw9okRK6zEm6rOw7cbMawcsnsbTbiGfIOvoa9T-KTWNgKciEcbDPMDN_fDOxgJqh1C64NN9S4Gyvf2V6tcrc3ZKSVNQqAXHFJ2AMi4vrxsCVHdjPOpiu2WqGlXactlXivnOYmEdnUYY8VuTtsD2WAAZYwW8hWyVI3ldgbmiyTXDpnddE5wrUHOBpGjayJnyMRxxsAL-JnANfeIbeT7EeQeGIo0pCLF1IuzMb8iUebQqdhxDGmGS5lbbYUcRziPINk7mll_memT7yyLo-80Qk5xh5GzABDfvJwWql2dXH-_fXz-1ddnj0Fb8E_)

### Describe the solution you'd like

It would be great, if the method group variant behaves like the lambda one as i see no obvious reason why it shouldn't.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the method-group and lambda examples in the two linked Razor playgrounds and compare their compiler behavior. Trace the Roslyn handling of cascading type parameters and method-group binding; done means the method-group variant behaves like the lambda variant, with regression coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.