ワンクリックで
nullability-warnings
How to fix enabled C# nullable reference type compiler warnings (CS8xxx)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
How to fix enabled C# nullable reference type compiler warnings (CS8xxx)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Inspect, unpack, edit, sign, and repack Ren'Py save files. Use when working with Ren'Py .save archives, save metadata JSON, screenshot/extra_info/log/signatures entries, machine save-token keys, or when a user asks to modify or repair a Ren'Py savegame.
correct modelling of C# datastructures for maintainable code
Correctly call native (C/C++) libraries from .NET using P/Invoke and LibraryImport. Covers function signatures, string marshalling, memory lifetime, SafeHandle, and cross-platform patterns. USE FOR: writing new P/Invoke or LibraryImport declarations, reviewing or debugging existing native interop code, wrapping a C or C++ library for use in .NET, diagnosing crashes, memory leaks, or corruption at the managed/native boundary. DO NOT USE FOR: COM interop, C++/CLI mixed-mode assemblies, or pure managed code with no native dependencies.
Guides activity tracing with generated ActivitySources, tags, parent activities, exception status handling, and registration. Use when adding or reviewing OpenTelemetry activity tracing in Bendex flows.
Microsoft code analysis CA warning meanings and examples
Routing guide for enabled compiler and analyzer warnings in this Bendex solution
| name | nullability-warnings |
| description | How to fix enabled C# nullable reference type compiler warnings (CS8xxx) |
Use this skill when the build reports nullable-reference diagnostics such as CS8602, CS8618, CS8625, or nullable contract mismatches on overrides, interfaces, delegates, partial methods, and attributes.
Source reference: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/nullable-warnings Resolution guide: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/null-safety/common-tasks/resolve-warnings
is not null pattern, ?., ??, or ??= when the warning is caused by dereferencing or passing a maybe-null value.? when the API contract is wrong. Use ? when missing data is a valid domain state; keep the type non-nullable when callers may rely on a value.[NotNullWhen], [NotNullIfNotNull], [MemberNotNull], and [DoesNotReturn] when helper methods change null-state in a way the compiler cannot infer.required init properties, or a meaningful declaration default. Do not invent sentinel defaults like "N/A" just to silence CS8618.Directory.Build.props enables nullable with <Nullable>enable</Nullable>.! only when a local invariant is already guaranteed and cannot be expressed cleanly to the compiler.CS8602, CS8670.CS8597, CS8600, CS8601, CS8603, CS8604, CS8605, CS8625, CS8629.CS8618.CS8607-CS8624, CS8631, CS8633, CS8634, CS8643-CS8645, CS8667, CS8714, CS8762-CS8777, CS8819, CS8824, CS8825.CS8655, CS8847.CS8597 - Thrown value may be nullWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
Exception? ex = GetException(); throw ex;throw ex ?? new InvalidOperationException();.CS8600 - Converting possible null to non-nullable typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
string name = maybeName; where maybeName is string?.string?, add a guard, or provide a fallback: maybeName ?? "".CS8601 - Possible null reference assignmentWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
_name = maybeName; when _name is non-nullable.CS8602 - Dereference of a possibly null referenceWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
message.Length when message is string?.message is not null before dereferencing.CS8603 - Possible null reference returnWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
return null; from a method declared string.string?.CS8604 - Possible null reference argumentWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
UseName(maybeName); where UseName requires string.string?.CS8605 - Unboxing a possibly null valueWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
var count = (int)maybeBoxed; when the boxed value can be null.maybeBoxed is int count before using it.CS8607 - Possible null value used with NotNull or DisallowNullWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
[DisallowNull] member.CS8608 - Nullability mismatch in overridden member typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8609 - Nullability mismatch in overridden return typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8610 - Nullability mismatch in overridden type parameterWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8611 - Nullability mismatch in partial method type parameterWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8612 - Nullability mismatch in implicitly implemented member typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8613 - Nullability mismatch in implicitly implemented return typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8614 - Nullability mismatch in implicitly implemented parameter typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8615 - Nullability mismatch in implemented member typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8616 - Nullability mismatch in implemented return typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
string? while interface returns string.CS8617 - Nullability mismatch in implemented parameter typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
string while interface allows string?.CS8618 - Non-nullable member is not initializedWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
public string Name { get; set; } is not initialized by the constructor.required, or declare string?.CS8619 - Value nullability does not match target typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
List<string?> to IEnumerable<string>.CS8620 - Argument nullability does not match parameter typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
IEnumerable<string?> to a parameter requiring IEnumerable<string>.CS8621 - Delegate return nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8622 - Delegate parameter nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8624 - Output argument nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
out string? value passed to out string parameter.CS8625 - Cannot convert null literal to non-nullable reference typeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
string name = null;.string?.CS8629 - Nullable value type may be nullWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
int count = maybeCount.Value; without checking HasValue.HasValue, use pattern matching, or provide a default.CS8631 - Type argument nullability does not satisfy constraintWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8633 - Constraint nullability does not match interface methodWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8634 - Type argument nullability does not satisfy class constraintWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
T? used where T : class expects non-null class type.CS8643 - Explicit interface specifier nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8644 - Interface member not implemented because nullability differsWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8645 - Interface member listed with different nullabilityWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8655 - Switch expression does not handle nullWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
string? has no null arm.null => ... arm or guard before the switch.CS8667 - Partial method declarations have inconsistent nullabilityWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8670 - Initializer dereferences a possibly null memberWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
new Container { Items = { "A" } } when Items may be null.Items to a non-null collection.CS8714 - Type argument violates notnull constraintWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
notnull constraint.CS8762 - Parameter must be non-null on exitWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8763 - DoesNotReturn method returnsWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
[DoesNotReturn] method can return normally.CS8764 - Override return nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8765 - Override parameter nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8766 - Implemented return nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8767 - Implemented parameter nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8768 - Implemented return type nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8769 - Implemented parameter type nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8770 - DoesNotReturn contract is not satisfiedWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8774 - Member must be non-null on exitWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
[MemberNotNull] member is still maybe-null on exit.CS8775 - Member must be non-null on exitWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8776 - Member name cannot be used in nullability attributeWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
[MemberNotNull("BadName")] references an invalid member.CS8777 - Parameter must be non-null on exitWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
[NotNullWhen(true)] parameter is not proven non-null.CS8819 - Partial member nullability mismatchWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8824 - Parameter contract must prove non-null on exitWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8825 - Return value must be non-null under attribute contractWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
CS8847 - Switch expression does not handle null inputWhen it appears: the nullable reference type analysis found this enabled warning in the project.
Example:
null.null explicitly or guard first.