Skip to content

IsStatic Seems to Check for Non-Static Classes #73

@lundmikkel

Description

@lundmikkel

The extension method IsStatic() checks if the type is a class that is not sealed and abstract at the same time:

public static bool IsStatic(this Type type)
{
    return type.IsClass && !(type.IsSealed && type.IsAbstract);
}

Shouldn't the method check if it is sealed and abstract?

public static bool IsStatic(this Type type)
{
    return type.IsClass && type.IsSealed && type.IsAbstract;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions