File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11// SPDX-FileCopyrightText: 2022 smdn <smdn@smdn.jp>
22// SPDX-License-Identifier: MIT
3+ #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER || NET5_0_OR_GREATER
4+ #define SYSTEM_TYPE_ISGENERICMETHODPARAMETER
5+ #endif
6+
37using System ;
48#if NULL_STATE_STATIC_ANALYSIS_ATTRIBUTES
59using System . Diagnostics . CodeAnalysis ;
@@ -58,9 +62,13 @@ out CustomAttributeData? attrNullableContext
5862 private static CustomAttributeData ? FindNullableContextAttribute ( Type genericParameter )
5963 {
6064 if (
65+ #if SYSTEM_TYPE_ISGENERICMETHODPARAMETER
6166 genericParameter . IsGenericMethodParameter &&
67+ #else
6268 genericParameter . DeclaringMethod is not null &&
63- TryGetNullableContextAttribute ( genericParameter . DeclaringMethod , out var methodAttr )
69+ genericParameter . IsGenericParameter &&
70+ #endif
71+ TryGetNullableContextAttribute ( genericParameter . DeclaringMethod ! , out var methodAttr )
6472 ) {
6573 return methodAttr;
6674 }
You can’t perform that action at this time.
0 commit comments