Skip to content

tsc -watch -- Range error: Maximum call stack size exceeded #22773

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

Closed
coyotte508 opened this issue Mar 21, 2018 · 3 comments
Closed

tsc -watch -- Range error: Maximum call stack size exceeded #22773

coyotte508 opened this issue Mar 21, 2018 · 3 comments

Comments

@coyotte508
Copy link

TypeScript Version: 2.7.2, 2.8.0-dev.2018031

Search Terms: Maximum call stack size exceeded

Code

class Hex<Data=any> {
    constructor(public q: number = 0, public r: number = 0, public data: Data = null) {
        
    }

    /**
     * Creates a child class that extends Hex, and initializes by default
     * with data = `defaultData`
     * 
     * @param defaultData 
     */
    static extend<Data>(defaultData: Data) {
        return class extends this<Data> {
            constructor(q: number, r: number, data?: Partial<Data>) {
                super(q, r, Object.assign({}, data, defaultData));
            }

            static defaultData = defaultData;
        }
    }
}

Expected behavior: tsc -watch works fine

Actual behavior: tsc -watch crashes, although tsc works fine

RangeError: Maximum call stack size exceeded
    at isAccessible (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22420:34)
    at trySymbolTable (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22426:21)
    at getAccessibleSymbolChainFromSymbolTable (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22412:30)
    at forEachSymbolTableInScope (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22373:34)
    at getAccessibleSymbolChain (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22407:20)
    at isSymbolAccessible (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22498:49)
    at isTypeSymbolAccessible (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22486:26)
    at typeToTypeNodeHelper (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:22796:83)
    at symbolToParameterDeclaration (C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:23175:41)
    at C:\Users\coyot\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:23129:89

Playground Link:

Related Issues:

#20695 , although the error log we get is different

@coyotte508
Copy link
Author

This was a duplicate, when removing the extra code I get the same error log.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 22, 2018

@coyotte508 can you share a self contained repro with a tsconfig.json file that we can try locally?

@coyotte508
Copy link
Author

@mhegazy This issue is a duplicate of #20695 , so you can disregard

@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants