Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversions on extension types #8340

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Aug 7, 2024

Relates to test plan dotnet/roslyn#66722

@jcouv jcouv self-assigned this Aug 7, 2024
Comment on lines +298 to +309
implicit extension EU for U
{
public static implicit operator EU(int i) => ...;
}
implicit extension EInt for int { }

R r = 42;
U u = 43;

EInt ei = 44;
R r = ei;
U u = ei;
Copy link

Choose a reason for hiding this comment

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

You have renamed the R extension to EU in the declaration, but not at the usage location :

Suggested change
implicit extension EU for U
{
public static implicit operator EU(int i) => ...;
}
implicit extension EInt for int { }
R r = 42;
U u = 43;
EInt ei = 44;
R r = ei;
U u = ei;
implicit extension EU for U
{
public static implicit operator EU(int i) => ...;
}
implicit extension EInt for int { }
EU eu = 42;
U u = 43;
EInt ei = 44;
EU eu = ei;
U u = ei;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants