Skip to content

RangeError: Maximum call stack size exceededΒ #50591

Closed
@Page-

Description

@Page-

Bug Report

πŸ”Ž Search Terms

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions 4.6.4 and 4.7.2

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

interface Request {
	body: any
}

const x: { [uuid: string]: number } = {};

(req: Request) => {
	x[uuid]++;

	const uuid = req.body.common_name;
}

πŸ™ Actual behavior

RangeError: Maximum call stack size exceeded
at resolveNameHelper (C:\ts-test\node_modules\typescript\lib\tsc.js:41378:21)
at resolveName (C:\ts-test\node_modules\typescript\lib\tsc.js:41165:20)
at resolveEntityName (C:\ts-test\node_modules\typescript\lib\tsc.js:42315:42)
at tryGetElementAccessExpressionName (C:\ts-test\node_modules\typescript\lib\tsc.js:58553:30)
at getAccessedPropertyName (C:\ts-test\node_modules\typescript\lib\tsc.js:58533:24)
at isMatchingReference (C:\ts-test\node_modules\typescript\lib\tsc.js:58516:78)
at getTypeAtFlowAssignment (C:\ts-test\node_modules\typescript\lib\tsc.js:59549:21)
at getTypeAtFlowNode (C:\ts-test\node_modules\typescript\lib\tsc.js:59476:32)
at getFlowTypeOfReference (C:\ts-test\node_modules\typescript\lib\tsc.js:59440:51)
at getFlowTypeOfAccessExpression (C:\ts-test\node_modules\typescript\lib\tsc.js:63184:28)

πŸ™‚ Expected behavior

The error message:

Block-scoped variable 'uuid' used before its declaration.ts(2448)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions