tests/cases/compiler/invariantGenericErrorElaboration.ts(3,7): error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
  Types of property 'constraint' are incompatible.
    Type 'Constraint<Num>' is not assignable to type 'Constraint<Runtype<any>>'.
      Types of property 'constraint' are incompatible.
        Type 'Constraint<Constraint<Num>>' is not assignable to type 'Constraint<Constraint<Runtype<any>>>'.
          Types of property 'constraint' are incompatible.
            Type 'Constraint<Constraint<Constraint<Num>>>' is not assignable to type 'Constraint<Constraint<Constraint<Runtype<any>>>>'.
              Type 'Constraint<Constraint<Runtype<any>>>' is not assignable to type 'Constraint<Constraint<Num>>'.
                Types of property 'underlying' are incompatible.
                  Type 'Constraint<Runtype<any>>' is not assignable to type 'Constraint<Num>'.
tests/cases/compiler/invariantGenericErrorElaboration.ts(4,19): error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.


==== tests/cases/compiler/invariantGenericErrorElaboration.ts (2 errors) ====
    // Repro from #19746
    
    const wat: Runtype<any> = Num;
          ~~~
!!! error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
!!! error TS2322:   Types of property 'constraint' are incompatible.
!!! error TS2322:     Type 'Constraint<Num>' is not assignable to type 'Constraint<Runtype<any>>'.
!!! error TS2322:       Types of property 'constraint' are incompatible.
!!! error TS2322:         Type 'Constraint<Constraint<Num>>' is not assignable to type 'Constraint<Constraint<Runtype<any>>>'.
!!! error TS2322:           Types of property 'constraint' are incompatible.
!!! error TS2322:             Type 'Constraint<Constraint<Constraint<Num>>>' is not assignable to type 'Constraint<Constraint<Constraint<Runtype<any>>>>'.
!!! error TS2322:               Type 'Constraint<Constraint<Runtype<any>>>' is not assignable to type 'Constraint<Constraint<Num>>'.
!!! error TS2322:                 Types of property 'underlying' are incompatible.
!!! error TS2322:                   Type 'Constraint<Runtype<any>>' is not assignable to type 'Constraint<Num>'.
!!! related TS2728 tests/cases/compiler/invariantGenericErrorElaboration.ts:12:3: 'tag' is declared here.
    const Foo = Obj({ foo: Num })
                      ~~~
!!! error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
!!! related TS6501 tests/cases/compiler/invariantGenericErrorElaboration.ts:17:34: The expected type comes from this index signature.
    
    interface Runtype<A> {
      constraint: Constraint<this>
      witness: A
    }
    
    interface Num extends Runtype<number> {
      tag: 'number'
    }
    declare const Num: Num
    
    interface Obj<O extends { [_ in string]: Runtype<any> }> extends Runtype<{[K in keyof O]: O[K]['witness'] }> {}
    declare function Obj<O extends { [_: string]: Runtype<any> }>(fields: O): Obj<O>;
    
    interface Constraint<A extends Runtype<any>> extends Runtype<A['witness']> {
      underlying: A,
      check: (x: A['witness']) => void,
    }
    