Skip to content

TypesExtensions.IsClosedTypeOf returns true when type is open-generic #951

@dotnetjunkie

Description

@dotnetjunkie

Describe the bug

The TypesExtensions.IsClosedTypeOf extension method is expected to return false when the supplied is open generic, but it sometimes returns true.

Expected behavior

IsClosedTypeOf should return false when supplied with an open-generic t ype

To Reproduce

// class GenX<T> : IX<T> { }
Assert.IsFalse(typeof(GenX<>).IsClosedTypeOf(typeof(IX<>)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions