|
| 1 | +title: Remaining errors introduced in C# 12 |
| 2 | +description: Not sure what the themes will be, but let's start |
| 3 | +f1_keywords: |
| 4 | + - "CS9123" |
| 5 | + - "CS9125" |
| 6 | + - "CS9205" |
| 7 | + - "CS9212" |
| 8 | + - "CS9213" |
| 9 | + - "CS9214" |
| 10 | + - "CS9215" |
| 11 | + - "CS9222" |
| 12 | + - "CS9229" |
| 13 | + - "CS9230" |
| 14 | + - "CS9231" |
| 15 | + - "CS9232" |
| 16 | + - "CS9233" |
| 17 | + - "CS9234" |
| 18 | + - "CS9235" |
| 19 | + - "CS9236" |
| 20 | +helpviewer_keywords: |
| 21 | + - "CS9123" |
| 22 | + - "CS9125" |
| 23 | + - "CS9205" |
| 24 | + - "CS9212" |
| 25 | + - "CS9213" |
| 26 | + - "CS9214" |
| 27 | + - "CS9215" |
| 28 | + - "CS9222" |
| 29 | + - "CS9229" |
| 30 | + - "CS9230" |
| 31 | + - "CS9231" |
| 32 | + - "CS9232" |
| 33 | + - "CS9233" |
| 34 | + - "CS9234" |
| 35 | + - "CS9235" |
| 36 | + - "CS9236" |
| 37 | +ms.date: 10/10/2025 |
| 38 | +--- |
| 39 | +# Errors and warnings introduced in C# 12 |
| 40 | + |
| 41 | +The following errors and warnings were introduced in C# 12: |
| 42 | + |
| 43 | +<!-- The text in this list generates issues for Acrolinx, because they don't use contractions. |
| 44 | +That's by design. The text closely matches the text of the compiler error / warning for SEO purposes. |
| 45 | + --> |
| 46 | + |
| 47 | +Unsafe. |
| 48 | +- [**CS9123**](#tbd): *The '&' operator should not be used on parameters or local variables in async methods.* |
| 49 | + |
| 50 | +Fixed sized buffers |
| 51 | +- [**CS9125**](#tbd): *Attribute parameter 'SizeConst' must be specified.* |
| 52 | + |
| 53 | +Weird ref safety, based on passing an interpolated string as an `out` parameter. |
| 54 | +- [**CS9205**](#tbd): *Expected interpolated string* |
| 55 | + |
| 56 | +// collection expressions |
| 57 | +- [**CS9212**](#tbd): *Spread operator '..' cannot operate on variables of type 'type' because 'type' does not contain a public instance or extension definition for 'member'* |
| 58 | +- [**CS9213**](#tbd): *Collection expression target 'type' has no element type.* |
| 59 | +- [**CS9214**](#tbd): *Collection expression type must have an applicable constructor that can be called with no arguments.* |
| 60 | +- [**CS9215**](#tbd): *Collection expression type 'type' must have an instance or extension method 'Add' that can be called with a single argument.* |
| 61 | +- [**CS9222**](#tbd): *Collection initializer results in an infinite chain of instantiations of collection 'type'.* |
| 62 | + |
| 63 | +invalid using declaration |
| 64 | +- [**CS9229**](#tbd): *Modifiers cannot be placed on using declarations* |
| 65 | + |
| 66 | +dynamic binding |
| 67 | +- [**CS9230**](#tbd): *Cannot perform a dynamic invocation on an expression with type 'type'.* |
| 68 | + |
| 69 | +interceptors |
| 70 | +- [**CS9231**](#tbd): *The data argument to InterceptsLocationAttribute is not in the correct format.* |
| 71 | +- [**CS9232**](#tbd): *Version 'version' of the interceptors format is not supported. The latest supported version is '1'.* |
| 72 | +- [**CS9233**](#tbd): *Cannot intercept a call in file 'file' because it is duplicated elsewhere in the compilation.* |
| 73 | +- [**CS9234**](#tbd): *Cannot intercept a call in file 'file' because a matching file was not found in the compilation.* |
| 74 | +- [**CS9235**](#tbd): *The data argument to InterceptsLocationAttribute refers to an invalid position in file 'file'.* |
| 75 | + |
| 76 | +lambda, but informational only |
| 77 | +- [**CS9236**](#tbd): *Compiling requires binding the lambda expression at least count times. Consider declaring the lambda expression with explicit parameter types, or if the containing method call is generic, consider using explicit type arguments.* |
| 78 | + |
| 79 | + |
0 commit comments