-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: typescript@2.8.0-dev.20180320
Search Terms: explicit any conversion
Code
function x(): any {
return 42
}
const y: string = x()
Expected behavior: I can use a compiler option to require an explicit cast from any
to string
, and the code above would give an error with that option enabled. Function x
in the example usually comes from a library definition file like: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9f4c75126167d0d8af759f58405d53d983e94ad0/types/yargs/index.d.ts#L226
Actual behavior: There is no such option.
Related Issues: #22464 (comment)
laurilehmijoki, ajafff and thomaseding
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript