Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find refs/get occurrences on type parameter of recursively defined type causes stack overflow #4977

Closed
DanielRosenwasser opened this issue Sep 25, 2015 · 2 comments
Labels
Bug A bug in TypeScript Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

interface I< [|T|] > extends I< [|T|] > {
}

Find all refs gets a stack overflow:

Description:

getDocumentHighlights('C:\Users\drosen\AppData\Local\Temp\~vsB119.ts', 25)

StackTrace:

Error: Out of stack space
   at isExpressionWithTypeArgumentsInClassExtendsClause (:6812:9)
   at isTypeNode (:5336:17)
   at getTypeOfNode (:25658:13)
   at getPropertySymbolFromTypeReference (:46637:25)
   at forEach (:865:17)
   at Anonymous function (:46630:29)
   at forEach (:865:17)
   at getPropertySymbolsFromBaseTypes (:46624:21)
   at getPropertySymbolFromTypeReference (:46644:29)
   at forEach (:865:17)
   at Anonymous function (:46630:29)
   at forEach (:865:17)
   at getPropertySymbolsFromBaseTypes (:46624:21)
   at getPropertySymbolFromTypeReference (:46644:29)
   at forEach (:865:17)
   at Anonymous function (:46630:29)
   at forEach (:865:17)
   at getPropertySymbolsFromBaseTypes (:46624:21)
   at getPropertySymbolFromTypeReference (:46644:29)
   at forEach (:865:17)
   at Anonymous function (:46630:29)
   at forEach (:865:17)
   at getPropertySymb......
@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Sep 25, 2015
@DanielRosenwasser DanielRosenwasser changed the title Find refs/get occurrences on type parameter causes stack overflow Find refs/get occurrences on type parameter of recursively defined type causes stack overflow Sep 25, 2015
@mhegazy mhegazy added this to the Community milestone Sep 25, 2015
@mhegazy mhegazy added the Help Wanted You can do this label Sep 25, 2015
@DanielRosenwasser DanielRosenwasser added Good First Issue Well scoped, documented and has the green light Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". and removed Good First Issue Well scoped, documented and has the green light labels Sep 26, 2015
@JoshuaKGoldberg
Copy link
Contributor

@DanielRosenwasser I'm no longer able to reproduce this bug with the following source, which has a type error:

// [ts] Type 'I<T>' recursively references itself as a base type. [2310]
interface I<T> extends I<T> {
}

@DanielRosenwasser
Copy link
Member Author

Regression test at #29433. Thanks for the heads up!

@DanielRosenwasser DanielRosenwasser removed this from the Community milestone Jan 15, 2019
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants