Skip to main content

CSharpExtensions.IsDefaultValue(SemanticModel, ITypeSymbol, ExpressionSyntax, CancellationToken) Method

Containing Type: CSharpExtensions

Assembly: Roslynator.CSharp.dll

Returns true if the specified expression represents default value of the specified type.

public static bool IsDefaultValue(this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.ITypeSymbol typeSymbol, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, System.Threading.CancellationToken cancellationToken = default)

Parameters

semanticModel SemanticModel

typeSymbol ITypeSymbol

expression ExpressionSyntax

cancellationToken CancellationToken

Returns

Boolean