In the HTML presentation I have not corrected these.
10.3.2 Comments The grammar production for delimited-comment-character is incorrect. In a comment with two * before the closing / (/* eg **/) the second production will eat both asterisks, and thus miss the trailing /. The not-slash of the second production is really a condition.
10.3 Declarations. This clause does not appear to specify the declaration space of a local constant declaration (neither does 15.5.2)
10.4.3 Enumeration members. The clause says the member of an enumeration are the constants declared in the enumeration and the members inherited from class object. Should this be System.Enum rather than object?
12.3.1 Initially assigned variables. I think a variable declared in a using statement is also initially assigned.
12.3.3.12 Return statements. The definite assignment state for a return statement with no expression (viz return;) is not covered.
12.3.3.15 Try-catch-finally statements. In the code example, the goto statement:
goto LABEL:needs to be
goto LABEL;Also, the labeled-statement:
LABEL:needs to be
LABEL:;
14.4.1 Argument lists Paragraph 2, sentence 1 states that the arguments of an indexer 17.8 are always passed as value parameters 17.5.1.1. However, Paragraph 6, sentence 1 states that indexers may declare their right most parameters to be parameter array 17.5.1.4. These two sentences appear to be contradictory because 17.5.1 (Paragraph 7) states that value parameters and parameter arrays are different. Note also that 10.6 (Paragraph 1, 3rd list item) does not mention whether the signature of an indexer includes a params array (yet it is mentioned in the first two list items about methods and instance constructors). The grammar for an indexer permits a params modifier (whereas, for example, the grammar for an operator does not). The Microsoft C# compiler permits a params modifier on an indexer.
14.5 Primary expressions. In the grammar production for primary-no-array-creation-expression I think the production sizeof-expression should only be allowed in unsafe code (see 25.5.8).
14.5.2.1 Invariant meaning in blocks Paragraph 1, sentences 1 and 2 read "For each occurrence of a given identifier as a simple-name in an expression, every other occurrence of the same identifier as a simple-name in an expression within the immediately enclosing block or switch-block must refer to the same entity. This rule ensures that the meaning of a name in the context of an expression is always the same within a block." The spec then contains the following example (not in an [Example: and so presumably normative)
class Test { double x; void F(bool b) { x = 1.0; if (b) { int x = 1; } } }and claims this results in a compile-time error. The intent may be that the example should result in a compile-time error (and it does in the Microsoft compiler) but the third occurrence of x occurs in a declarator and not in an expression (as specified in sentence 1).
14.6 Unary expressions. In the grammar production for unary-expression I think the productions * unary-expression and & unary-expression should only be allowed in unsafe code (see 25.5.1 and 25.5.4).
15.8.4 The foreach statement. In paragraph 7, sentence 2, think the type of the local variable enumerator be E and not Enumerator (see paragraph 4, sentence 2).
17.5.1 Method parameters. Paragraph 5, sentence 4 reads "Thus it is a compile-time error for a parameter or local variable to have the same name as another parameter or local variable." Is this correct? Other clauses (eg 10.3, paragraph 4, Note, class A) state that a conforming program can declare two local variables in a method block as long they are in non-overlapping nested blocks.
17.5.4 Override methods. Paragraph 1, sentence 2 reads "An override method overrides an inherited virtual method with the same signature." The signature does not include the return type and I can find nothing in this clause on the relationship between the return type of the overridden base method and the override method. This also affects 17.5.5 (Sealed methods) and 17.5.6 (Abstract methods).
17.6.2 Accessors. Paragraph 1, sentence 6 reads "Since a set accessor implicitly has a parameter named value, it is a compile time error for a local variable declaration in a set accessor to have that name." Presumably it is also a compile-time error to have a local constant declaration named value in a set accessor.
17.7.2 Event accessors. Paragraph 5, sentence 1 reads "Since an event accessor implicitly has a parameter named value, it is a compile-time error for a local variable declared in an event accessor to have that name." Presumably it is also a compile time error to have a local constant declaration named value in an event accessor.
20.2.5 Interface member access Paragraph 1, sentence 1 contains the words "...where I is an instance of an interface type...". but you cannot create instances of interface types.
24.2 Attribute specification.
Paragraph 2. In the grammar productions for global-attribute-section and
attribute-section there are productions that end
,]
and not
, ]
implying you cannot separate the , and the ]
with whitespace.
24.2 Attribute specification. Paragraph 1, sentence 3. Fails to say that attributes can be specified for struct-member-declarations.
24.2 Attribute specification. Paragraph 2. The attribute-target productions does not include module (but it does in appendix A).
24.4.2 The Conditional attribute. Paragraph 2, first list item. Fails to say that the conditional method can be a method in a struct-declaration.
A.1.7 Keywords. The keyword volatile is not in the table (but it is in 9.4.3).
A.2.4 Expressions. In the grammar production for unary-expression I think the production * unary-expression should only be allowed in unsafe code (see P364, L11).
In the HTML presentation I have corrected these typos (mostly).
8.5 Expressions. The table is missing two section numbers. Unary operators are covered in clause 14.6. Shift operators are covered in clause 14.8.
8.7.4 Properties. Pedantically, the code example won't compile because Repaint cannot be resolved. Some ... for ellision maybe?
8.10 Delegates. In the code fragment the for statement is missing a left brace.
9.4.2 Identifiers. Paragraph 1, sentence 1. language), should be language).
9.4.4.5 String literals. In the grammar production for the non-terminal verbatim-string-literal there is a spurious space between verbatim and -string-literal-charactersopt
9.4.4.5 String literals. The grammar production for the non-terminal single-verbatim-string-literal-character, the rhs starts with the word any (with a lowercase a) and in all other similar cases it is Any (with an uppercase A).
9.5.4 Conditional compilation directives.
The grammar production for the non-terminal pp-if-section
is on two lines. The
sectionopt
is really part of the previous line.
9.5.4 Conditional compilation directives.
The grammar production for the non-terminal pp-elif-section
is on two lines. The
sectionopt
is really part of the previous line.
9.5.4 Condititional compilation directives Pedantically, the code examples need ... for ellision.
12.1.1 Static variables. Paragraph 1, sentence 2. The sentence ends with two full stops.
12.3.3 Precise rules for determining definite assignment. Paragraph 2, sentence 12. Sentence reads "...the state of a variable the isn't definitely...". I think it should be this instead: "...the state of a variable that isn't definitely...".
14.2.2 Operator overloading. Paragraph 9. [Note:While... should be [Note: While...
14.5.4.1 Identical simple names and type names In the example code, there are three // comments that spill over to the next line.
14.9.6 Reference type equality operators. Paragraph 5. In the code example, the keyword using starts with an uppercase U.
14.9.7 String equality operators. Paragraph 1, sentence 1. Ends in two colons rather than one colon.
17.2.6.2 Declared accessibility. Paragraph 1, sentence 1 reads "Non-nested types can have public or internal declared accessibility and they internal declared accessibility by default." Should this be... "Non-nested types can have public or internal declared accessibility and they have internal declared accessibility by default."
17.4 Fields. The last sentence of the 2nd paragraph is duplicated.
17.4.3 Volatile fields. Paragraph 2. In the example, the sentence reads "Since result has been declared volatile...". However, in the code result is not declared as a volatile field.
17.6.2 Accessors The last code example, shows a fragment of the Console class and should really include ... for ellision (note that the static Console calls to the OpenStandardXXXX).
17.7 Events.
The grammar production for the non-terminal event-declaration
is on two lines. The
}
on its own line is really part of the previous line.
17.9.1 Unary operators. Paragraph 3. In the code example, Main does not have a closing right brace.
17.10.3 Constructor execution. Paragraph 1. An [Example: is started within an [Example:
18.4.1 Database integer type. // Many comments have spilled into two lines.
18.4.2 Database boolean type. // Many comments have spilled into two lines.
20.1 Interface declarations.
The grammar production for the non-terminal interface-declaration
is on two lines. The
;opt
on its own line is really part of the previous line
22.1 Delegate declarations.
The grammar production for the non-terminal delegate-declaration
is on two lines. The
( formal-parameter-listopt ) ;
on is really part of the previous line.
25.1 Unsafe contexts. Why is the [Example: after the grammar production in a list bullet?
25.6 The fixed statement. Paragraph 5, sentence 2. possible.[Example: should be possible. [Example:
25.8 Dynamic memory allocation. A // comment has spilled into two lines.
B.3 Unspecified behavior. floator should be float or
C.10 Properties. Sudden change of font.
There are numerous cases where examples have not been written inside an [Example: ... end example] and notes have not been written inside a [Note: ... end note]. This means they are normative rather than informative as specified in 7. Eg., 14.5.2.1, the first sentence is normative, the second sentence should be in a [Note: ... end note], the third and fourth sentences should be in an [Example: ... end example] (they even use the word example), the fifth sentence should be in a [Note: ... end note] (it uses the word note). In contrast, the last sentence is labelled as an informative [Example: ... end example]
10.6 Signatures and overloading. Paragraph 1, sentence 2 says that the ref and out parameter modifiers are part of a methods signature. The example in paragraph 2 shows F(ref int) and F(out int) overloading each other. The Microsoft C# compiler does not allow F(ref int) and F(out int) to overload each other.
10.7 Scopes. Paragraph 3. One sentence in the [Note: reads "... possibly leading to compile-time errors if the statements of the block were later to be rearranged." I cannot see how any rearrangement would lead to a compile-time error.
11.1.3 Simple Types. The second list item (paragraph 3, sentence 5) reads "When the operands of an expression are all simple type constants it is possible for the compiler to evaluate the expression at compile time. Such an expression is known as a constant expression". It is not only possible it is required by 14.15 paragraph 3, sentence 1: "Whenever an expression is of one of the types listed above and contains only the constructs listed above, the expression is evaluated at compile-time.
11.1.6 The decimal type. Paragraph 1, sentence 1. What is the difference between financial and a monetary calculation?
23 Exceptions 2nd bullet, 2nd sentence claims "Such code is difficult to write in C++ without duplicating code." Should the C# language spec be mentioning C++ like this? (regardless of whether the sentence is true, which is debatable).
24.2 Attributes Paragraph 7, sentence 4 "If the attribute-name is spelled using a verbatim identifier, then only an attribute without a suffix is matched, thus enabling such an ambiguity to be resolved". This requirement is not in the C# Language spec from Microsoft and is not currently supported by the Microsoft C# compiler.
|
|
Jagger Software Ltd | |
Company # 4070126 | |
VAT # 762 5213 42 |