Skip to content

Crash when requesting property type from a generic constructor function's instantiation #26641

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
sandersn opened this issue Aug 23, 2018 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Duplicate An existing issue was already created

Comments

@sandersn
Copy link
Member

sandersn commented Aug 23, 2018

/**
 * @template T
 * @param {T} actual
 * @param {T} expect
 */
var AssertionError = function (actual, expect) {
    this.name = 'AssertionError';
    this.actual = actual;
    this.expected = expect;
}
var onetwo = new AssertionError(1,2)
onetwo.actual/**/

Expected behavior:
No crash when requesting quickinfo at /**/

Actual behavior:
Crash in getOuterTypeParameters, indicating that we called it with a type that is not a real GenericType, and there doesn't have cached outer type parameters. This is very likely because the types created for constructor functions are not real GenericTypes.

Related Issues: Maybe #25618 ?

Edit: I thought this might be recent regression, but it repros on 3.0 and 2.9 as well.

@sandersn sandersn self-assigned this Aug 23, 2018
@sandersn sandersn added Bug A bug in TypeScript Salsa Domain: JSDoc Relates to JSDoc parsing and type generation labels Aug 23, 2018
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Aug 24, 2018
@sandersn
Copy link
Member Author

This is a sub-issue of #26883; anything that fixes that should test that it also fixes this bug.

Duplicate of #26883

@sandersn sandersn added the Duplicate An existing issue was already created label Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants