dotnet/roslyn

Bad comment

Open

#15.589 aberto em 29 de nov. de 2016

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)C# (4.257 forks)batch import
Area-CompilersDocumentationhelp wanted

Métricas do repositório

Stars
 (20.414 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (256 fundiu PRs em 30d)

Description

I found the following in the C# compiler.

// SPEC OMISSION: The C# 2.0 spec had a line in it that noted that the expressions "null == null"
// SPEC OMISSION: and "null != null" were to be automatically treated as the appropriate constant;
// SPEC OMISSION: overload resolution was to be skipped.  That's because a strict reading
// SPEC OMISSION: of the overload resolution spec shows that overload resolution would give an
// SPEC OMISSION: ambiguity error for this case; the expression is ambiguous between the int?,
// SPEC OMISSION: bool? and string versions of equality.  This line was accidentally edited
// SPEC OMISSION: out of the C# 3 specification; we should re-insert it. 

But the ECMA standard 13.11.1 covers this:

If both operands of an equality-expression are the null literal, then overload resolution is not performed and the expression evaluates to a constant value of true or false according to whether the operator is == or !=.

The comment should be corrected.

Guia do colaborador