Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

[Blazor] Avoid redundantly qualifying event callback type checks #88

Merged
merged 2 commits into from
Mar 9, 2022

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Mar 8, 2022

There were a couple of issues here:

  • The code that parsed EventCallback type arguments didn't account for global::.
  • Once that got fixed, the EventCallback code wasn't distinguishing between explicit types and implicit/inferred types.
  • For inferred types, there were two cases:
    • One where the type was replaced by a user defined type. In this case, we need to call CreateEventCallback<Type>
    • Two where the type was not replaced and needed to be inferred. In this case we need to call CreateEventCallback because the argument is being inferred using CreateInferredEventCallback

The change uses properties to track whether the user provided a type explicitly in code and whether we were able to replace the generic type properties in EventCallback and uses those facts to influence code generation.

@javiercn javiercn requested a review from a team as a code owner March 8, 2022 14:19
@javiercn javiercn force-pushed the javiercn/fix-event-callback branch from 88c589d to 2223160 Compare March 8, 2022 14:21
@javiercn javiercn force-pushed the javiercn/fix-event-callback branch from 2223160 to 2cdfdf6 Compare March 9, 2022 13:32
@javiercn javiercn enabled auto-merge (squash) March 9, 2022 13:56
@javiercn javiercn disabled auto-merge March 9, 2022 13:56
@javiercn javiercn enabled auto-merge (squash) March 9, 2022 13:57
@javiercn javiercn force-pushed the javiercn/fix-event-callback branch from 9be4bd7 to 02847e1 Compare March 9, 2022 18:02
Copy link
Contributor

@TanayParikh TanayParikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some clarifying questions for my understanding.

@javiercn javiercn merged commit ba467bb into main Mar 9, 2022
@javiercn javiercn deleted the javiercn/fix-event-callback branch March 9, 2022 18:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants