Open sandboxFocus

Method GetTopmostNamedType

GetTopmostNamedType(IDeclaration)

Gets the topmost type of a nested type, i.e. a type that is not contained in any other type. If the given type is not a nested type, returns the given type itself.

Declaration
public static INamedType? GetTopmostNamedType(this IDeclaration declaration)
Parameters
Type Name Description
IDeclaration declaration

The declaration.

Returns
Type Description
INamedType

The topmost named type in the nesting hierarchy, or null if none is found.