Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Fix: visiting superTypeParameters in classes #561

Merged
merged 4 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions analyze-scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ class Referencer extends OriginalReferencer {
*/
visitClass(node) {
this.visitDecorators(node.decorators);

if (node.superTypeParameters) {
const upperTypeMode = this.typeMode;
this.typeMode = true;
this.visit(node.superTypeParameters);
this.typeMode = upperTypeMode;
}

super.visitClass(node);
}

Expand Down
11 changes: 11 additions & 0 deletions tests/fixtures/scope-analysis/class-supper-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
abstract class Foo extends Bar<Baz> {
mysticatea marked this conversation as resolved.
Show resolved Hide resolved

}

declare class Foo2 extends Bar<Baz> {

}

class Foo3 extends Bar<Baz> {

}
Loading