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

Fix implicit conversion for Union #8347

Open
flobernd opened this issue Sep 16, 2024 · 0 comments
Open

Fix implicit conversion for Union #8347

flobernd opened this issue Sep 16, 2024 · 0 comments
Labels
8.x Relates to 8.x client version Area: Generator Category: Bug

Comments

@flobernd
Copy link
Member

Union implements implicit conversion like this:

public static implicit operator Union<TFirst, TSecond>(TFirst first) => new(first);
public static implicit operator Union<TFirst, TSecond>(TSecond second) => new(second);

When a class derives from Union<,> the implicit conversion operators can't be used, because their result Union<,> can't be upcasted to the derived type.

To fix this issue, code generator should always generate specialized conversion operators for types derived from Union<,>.

Related to #8345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to 8.x client version Area: Generator Category: Bug
Projects
None yet
Development

No branches or pull requests

1 participant