-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeCommittedThe team has roadmapped this issueThe team has roadmapped this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
Say I have the following:
interface Options {
doSomethingSpecial?: boolean
}
function configure(options: Options) {}
configure({});
The preceding (correctly) does not flag any issues. However, say I change the function call to:
configure({doSomethingSuper: true});
This also does not flag any issues. I understand that in many (most?) cases this is the desired behavior, but in other cases it seems that a stricter matching (ie, you don't have to specify "doSomethingSpecial" but you can't specify anything else either) would be desirable. There are at least two instances that I can think of where this applies:
- Catching typos
- (more importantly) Compile-time checking after a refactoring of "doSomethingSpecial" to be named something else
Perhaps some new syntax for enabling this mode would be useful. For example:
function configure(options: Options!) {}
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeCommittedThe team has roadmapped this issueThe team has roadmapped this issueSuggestionAn idea for TypeScriptAn idea for TypeScript