Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Type-checking fails with skipLibCheck: false #483

@geigerzaehler

Description

@geigerzaehler

Since v7.0.3 Typescript errors when checking the library definition files:

One tiny thing: Now `tsc` shows the following errors:

```node_modules/.pnpm/[email protected]/node_modules/runtypes/script/Runtype.d.ts:73:75 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'Validated<T, U>' is not assignable to type 'IsGeneric<this> extends true ? U : Maybe<T, U>'.
    Type 'T | (T & U)' is not assignable to type 'IsGeneric<this> extends true ? U : Maybe<T, U>'.
      Type 'T' is not assignable to type 'IsGeneric<this> extends true ? U : Maybe<T, U>'.

73     guard<U = T>(x: IsGeneric<this> extends true ? U : Maybe<T, U>): x is Validated<T, U>;
                                                                             ~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/runtypes/script/Runtype.d.ts:77:84 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'Validated<T, U>' is not assignable to type 'IsGeneric<this> extends true ? U : Maybe<T, U>'.
    Type 'T | (T & U)' is not assignable to type 'IsGeneric<this> extends true ? U : Maybe<T, U>'.
      Type 'T' is not assignable to type 'IsGeneric<this> extends true ? U : Maybe<T, U>'.

77     assert<U = T>(x: IsGeneric<this> extends true ? U : Maybe<T, U>): asserts x is Validated<T, U>;
                                                                                      ~~~~~~~~~~~~~~~

It’s easy to work around this with skipLibCheck: true though.

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