Skip to content

Gracefully parse 'super' with type arguments (#10677)#30913

Merged
RyanCavanaugh merged 1 commit into
microsoft:masterfrom
soon:i10677
Apr 15, 2019
Merged

Gracefully parse 'super' with type arguments (#10677)#30913
RyanCavanaugh merged 1 commit into
microsoft:masterfrom
soon:i10677

Conversation

@soon
Copy link
Copy Markdown
Contributor

@soon soon commented Apr 13, 2019

Changes the way we are parsing the following code:

class C<T> {
    foo: T;
    bar<U>(x: U) { }
}

class D<T> extends C<T> {
    constructor() {
        super<T>();
    }
    bar() {
        super.bar<T>(null);
    }
}

This will now throw error TS2754: 'super' may not use type arguments. instead of

error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
error TS1034: 'super' must be followed by an argument list or member access.
error TS2377: Constructors for derived classes must contain a 'super' call.

Fixes #10677

@RyanCavanaugh RyanCavanaugh merged commit 13d9f08 into microsoft:master Apr 15, 2019
@RyanCavanaugh
Copy link
Copy Markdown
Member

Thanks!

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gracefully parse 'super' with type arguments

2 participants