Skip to content

Fix markdown conversion issues in the variance section. #619

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

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions standard/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ A type is ***output-safe*** if it is not output-unsafe, and ***input-safe*** if

The purpose of variance annotations is to provide for more lenient (but still type safe) conversions to interface and delegate types. To this end the definitions of implicit ([§10.2](conversions.md#102-implicit-conversions)) and explicit conversions ([§10.3](conversions.md#103-explicit-conversions)) make use of the notion of variance-convertibility, which is defined as follows:

A type `T<Aᵢ, ..., Aᵥ>` is variance-convertible to a type `T<Bᵢ, ..., Aᵥ>` if `T` is either an interface or a delegate type declared with the variant type parameters `T<Xᵢ, ..., Xᵥ>`, and for each variant type parameter `Xᵢ` one of the following holds:
A type `T<Aᵢ, ..., Aᵥ>` is variance-convertible to a type `T<Bᵢ, ..., Bᵥ>` if `T` is either an interface or a delegate type declared with the variant type parameters `T<Xᵢ, ..., Xᵥ>`, and for each variant type parameter `Xᵢ` one of the following holds:

- `Xᵢ` is covariant and an implicit reference or identity conversion exists from `Aᵢ` to `Aᵢ`
- `Xᵢ` is covariant and an implicit reference or identity conversion exists from `Aᵢ` to `Bᵢ`
- `Xᵢ` is contravariant and an implicit reference or identity conversion exists from `Bᵢ` to `Aᵢ`
- `Xᵢ` is invariant and an identity conversion exists from `Aᵢ` to `Bᵢ`

Expand Down