-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeFixedA PR has been merged for this issueA PR has been merged for this issueSpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification
Milestone
Description
The compiler already behaves as per spec, and variables referenced directly or indirectly in their initializers resolve to any. The previous implementation did not just assign them to any, by attempted to go deeper one level, here are some examples;
var a = { f: a };Now:
a : any
Was:
a: { f: any };
var fibonacci = _.memoize(n => n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); } );
Now:
fibonacci : any
Was:
fibonacci : (n: any) => any
var n1 = n1++;Now:
n1 : any
Was:
n1 : number
see tests:
- tests/cases/compiler/recursiveObjectLiteral.ts
- tests/cases/compiler/underscoreTest1_underscoreTests.ts
- tests/cases/conformance/statements/VariableStatements/recursiveInitializer.ts
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeFixedA PR has been merged for this issueA PR has been merged for this issueSpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification