dotnet / dotnet/csharpstandard

15.11.4 (25.1.10 in existing Standard)) Operators in generic classes

Open
#72 9 comments 0 reactions 0 assignees View on GitHub
type: clarity
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

Raised by Kurakawa-san in July 2006

25.1.10 Operators in generic classes -- 3rd paragraph goes:

For a conversion operator that converts from a source type S to a target type T, when the
rules specified in 17.9.3 are applied, any type parameters associated with S or T are
considered to be unique types that have no inheritance relationship with other types, and
any constraints on those type parameters are ignored.

However, the following example shows the third operator is an error because C is the
base class of D.

This indicates that the 3rd paragraph tries to mean that

For a conversion operator that converts from a source type S to a target type T, when the
rules specified in 17.9.3 are applied, any type parameters associated with S or T shall
be unique types that have no inheritance relationship with other types.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.