Skip to content

Generic checking error #18387

Closed
Closed
@tinganho

Description

@tinganho

I think #16368 broke this code for me:

class Model {}

class Collection<M extends Model> {
    m: M;
}

class User extends Model {
}

class Users extends Collection<User> {
}

type CollectionClass = typeof Collection;
let a: CollectionClass = Users; // Error 'User' is not assignable to 'M' 

If I provide the --noStrictGenericChecks flag, it compiles without any complaints. Can I correct this without using the flag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions