Skip to content

JS type argument defaulting should give implicit 'any' error #25609

Closed
@ghost

Description

TypeScript Version: 3.0.0-dev.20180711

Code

tsconfig.json

{
    "compilerOptions": {
        "strict": true,
        "allowJs": true,
        "checkJs": true
    }
}

a.js

/**
 * @template T
 * @return {T}
 */
function f() { return x; }
const x = f();

Expected behavior:

Error somewhere that x is implicitly any.

Actual behavior:

No error.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDesign LimitationConstraints of the existing architecture prevent this from being fixedDomain: JSDocRelates to JSDoc parsing and type generationcheckJsRelates to checking JavaScript using TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions