public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol)
            {
                TypeSyntax typeSyntax = AddInformationTo(ToIdentifierName(symbol.Name));

                if (symbol.NullableAnnotation() == NullableAnnotation.Annotated)
                {
                    typeSyntax = AddInformationTo(NullableType(typeSyntax));
                }

                return(typeSyntax);
            }
예제 #2
0
                /// <summary>This only checks the use of a type parameter. We're checking their definition (looking at type constraints) elsewhere.</summary>
                public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
                {
                    if (symbol.IsReferenceType &&
                        symbol.NullableAnnotation() == NullableAnnotation.None)
                    {
                        // Example:
                        // I<TReferenceType~>
                        return(true);
                    }

                    return(false);
                }