-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
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 [email protected]
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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue