diff --git a/docs/csharp/language-reference/compiler-messages/cs8355.md b/docs/csharp/language-reference/compiler-messages/cs8355.md new file mode 100644 index 0000000000000..e428f90d5c007 --- /dev/null +++ b/docs/csharp/language-reference/compiler-messages/cs8355.md @@ -0,0 +1,35 @@ +--- +description: "Compiler Error CS8355" +title: "Compiler Error CS8355" +ms.date: 12/10/2023 +f1_keywords: + - "CS8355" +helpviewer_keywords: + - "CS8355" +--- +# Compiler Error CS8355 + +An in parameter cannot have the Out attribute. + +The parameter of a method can't be declared as read only, while informing interop marshaler to treat this parameter as writable by the native code. +
will contradict to the `in` keyword when [marshalling](../../../standard/native-interop/type-marshalling.md). + +## Example + +The following sample generates CS8355: + +```csharp +using System.Runtime.InteropServices; + +class Program +{ + public static void Example([Out] in int value) // CS8355 + { + } +} +``` + +## See also + +- [Default Marshalling Behavior](../../../framework/interop/default-marshalling-behavior.md) +- [Reference parameters](../keywords/method-parameters.md#reference-parameters) diff --git a/docs/csharp/language-reference/compiler-messages/toc.yml b/docs/csharp/language-reference/compiler-messages/toc.yml index 469d80e7a4b36..23c400d40f763 100644 --- a/docs/csharp/language-reference/compiler-messages/toc.yml +++ b/docs/csharp/language-reference/compiler-messages/toc.yml @@ -1608,6 +1608,8 @@ items: href: cs8334.md - name: CS8354 href: cs8354.md + - name: CS8355 + href: cs8355.md - name: CS8403 href: cs8403.md - name: CS8410 diff --git a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md index 83a33773c430b..a88eac6e22c36 100644 --- a/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md +++ b/docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md @@ -329,7 +329,6 @@ f1_keywords: - "CS8349" - "CS8350" - "CS8353" - - "CS8355" - "CS8356" - "CS8357" - "CS8359"