Skip to content

.IsTypeOf<>() is not available for DateTime #3183

@Dona278

Description

@Dona278

We have a value returned from method which works with generic, so we want to check the returned type and seems that DateTime doesn't work in the same way of other types.

(assign null is only for example)

// This works
string? a = null;
await Assert.That(a).IsTypeOf<DateTime>();

// This not compile
DateTime? b = null;
await Assert.That(b).IsTypeOf<DateTime>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions