Skip to main content

CSharpExtensions.HasConstantValue(SemanticModel, ExpressionSyntax, CancellationToken) Method

Containing Type: CSharpExtensions

Assembly: Roslynator.CSharp.dll

Returns true if the specified node has a constant value.

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

Parameters

semanticModel SemanticModel

expression ExpressionSyntax

cancellationToken CancellationToken

Returns

Boolean