tests/cases/compiler/excessPropertyCheckWithSpread.ts(6,3): error TS2345: Argument of type '{ n: number; a: number; }' is not assignable to parameter of type '{ a: any; }'.
  Object literal may only specify known properties, and 'n' does not exist in type '{ a: any; }'.
tests/cases/compiler/excessPropertyCheckWithSpread.ts(16,3): error TS2345: Argument of type '{ opt: string | number; a: number; }' is not assignable to parameter of type '{ a: any; }'.
  Object literal may only specify known properties, and 'opt' does not exist in type '{ a: any; }'.


==== tests/cases/compiler/excessPropertyCheckWithSpread.ts (2 errors) ====
    declare function f({ a: number }): void
    interface I {
        readonly n: number;
    }
    declare let i: I;
    f({ a: 1, ...i });
      ~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ n: number; a: number; }' is not assignable to parameter of type '{ a: any; }'.
!!! error TS2345:   Object literal may only specify known properties, and 'n' does not exist in type '{ a: any; }'.
    
    interface R {
        opt?: number
    }
    interface L {
        opt: string
    }
    declare let l: L;
    declare let r: R;
    f({ a: 1, ...l, ...r });
      ~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ opt: string | number; a: number; }' is not assignable to parameter of type '{ a: any; }'.
!!! error TS2345:   Object literal may only specify known properties, and 'opt' does not exist in type '{ a: any; }'.
    