TypeScript Version: nightly (2.4.0-dev.20170608)
Code
declare let compilerOptions: ts.CompilerOptions;
const options: ts.CompilerOptions = {
...compilerOptions,
noEmit: true,
noUnusedLocals: true,
...{noUnusedParameters: true}, // was originally ...(condition ? {noUnusedParameters: true} : undefined)
};
Expected behavior:
No error as with typescript@2.3.4
Actual behavior:
error TS2322: Type '{ noEmit: true; noUnusedLocals: true; allowJs?: boolean | undefined; allowSyntheticDefaultImports...' is not assignable to type 'CompilerOptions'.
Type '{ noEmit: true; noUnusedLocals: true; allowJs?: boolean | undefined; allowSyntheticDefaultImports...' is not assignable to type 'CompilerOptions'.
Index signature is missing in type '{ noEmit: true; noUnusedLocals: true; allowJs?: boolean | undefined; allowSyntheticDefaultImports...'.
To make this work, I need to assign the object literal to a variable with a type annotation containing an index signature.
TypeScript Version: nightly (2.4.0-dev.20170608)
Code
Expected behavior:
No error as with typescript@2.3.4
Actual behavior:
To make this work, I need to assign the object literal to a variable with a type annotation containing an index signature.