Open sandboxFocus

Method IsDefinitionSafe

IsDefinitionSafe(ISymbol)

Determines whether a symbol is its own definition, using equality comparison rather than identity.

Declaration
public static bool IsDefinitionSafe(this ISymbol symbol)
Parameters
Type Name Description
ISymbol symbol

The Roslyn symbol.

Returns
Type Description
bool

true if the symbol is a definition; otherwise false.

Remarks

This method differs from IsDefinition in that it uses equality comparison, making it tolerant to non-identical but equal symbol instances. Tuple types are always considered definitions.