File tree Expand file tree Collapse file tree 1 file changed +21
-29
lines changed Expand file tree Collapse file tree 1 file changed +21
-29
lines changed Original file line number Diff line number Diff line change @@ -12,35 +12,27 @@ ms.assetid: 14196659-aaac-4df2-a4ed-0bebb8097d59
1212
1313Type expected
1414
15- A type parameter is expected.
16-
17- ## Example
15+ A type has not been specified where expected, when [ overloading an operator] ( ../language-reference/operators/operator-overloading.md ) .
1816
19- The following sample generates CS1031:
20-
21- ``` csharp
22- // CS1031.cs
23- namespace x
24- {
25- public class ii
26- {
27- }
28-
29- public class a
17+ ## Example
18+
19+ The following sample generates CS1031:
20+
21+ ``` csharp
22+ namespace x
23+ {
24+ public class I
25+ {
26+ }
27+
28+ public class A
3029 {
31- public static operator +(a aa) // CS1031
32- // try the following line instead
33- // public static ii operator +(a aa)
34- {
35- return new ii ();
36- }
37-
38- public static void Main()
39- {
40- e = new base; // CS1031, not a type
41- e = new this; // CS1031, not a type
42- e = new (); // CS1031, not a type
43- }
44- }
45- }
30+ public static operator +(A aa) // CS1031
31+ // try the following line instead
32+ // public static ii operator +(a aa)
33+ {
34+ return new ii ();
35+ }
36+ }
37+ }
4638```
You can’t perform that action at this time.
0 commit comments