diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullableRefTypes.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullableRefTypes.cs index 775709b0e..bb13103e7 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullableRefTypes.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullableRefTypes.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty { @@ -184,4 +185,27 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty throw new NotImplementedException(); } } + + public class T08_NullablePostconditionAttributes + { + public bool TryGet(string key, [MaybeNullWhen(false)] out string value) + { + value = null; + return false; + } + + public static void ThrowIfNull([NotNull] object? o) + { + if (o == null) + { + throw new ArgumentNullException("o"); + } + } + + [return: MaybeNull] + public T FirstOrDefault(IEnumerable source) + { + return default(T); + } + } }