示例#1
0
        private static bool IsNotNullableReplacable(this NameSyntax name, TypeSyntax reducedName)
        {
            var isNotNullableReplacable = false;

            // var isLeftSideOfDot = name.IsLeftSideOfDot();
            // var isRightSideOfDot = name.IsRightSideOfDot();

            if (reducedName.Kind() == SyntaxKind.NullableType)
            {
                if (((NullableTypeSyntax)reducedName).ElementType.Kind() == SyntaxKind.OmittedTypeArgument)
                {
                    isNotNullableReplacable = true;
                }
                else
                {
                    isNotNullableReplacable = name.IsLeftSideOfDot() || name.IsRightSideOfDot();
                }
            }

            return(isNotNullableReplacable);
        }