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

Support covariance #60

Open
pascalberger opened this issue Nov 21, 2019 · 1 comment
Open

Support covariance #60

pascalberger opened this issue Nov 21, 2019 · 1 comment

Comments

@pascalberger
Copy link
Collaborator

It should be possible to return a Maybe<Bar> in a method with return type Maybe<Foo>, where Bar inherits from Foo.

@marco-bertschi
Copy link
Contributor

Had a deeper look at this (together with @stefan-lindegger), and at the moment there's no covariance support at class or struct level (see this post from Eric Lippert).
Our use case is covered in this discussion 2498 in the C# language repo, I'd keep this issue open until they've clarified there if and in what manner the language is moving forwards on that matter.

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

Successfully merging a pull request may close this issue.

2 participants