Open philipp-sorin opened 5 years ago
Version: 2.2.0
Overview
Type#getTypeArguments() returns first subclass as instance of TypeParameter At least when it was got as ClassDeclaration#getExtends().getType()
Sampe
//file Parent.ts export class Parent { } //file Child.ts import { Parent } from "./Parent" class Child extends Parent { } // file Plugin.ts const project = new Project(); const sf = project.getSourceFile("Child.ts"); const ta = sf.getClasses()[0].getExtends().getType().getTypeArguments(); console.assert(ta.length === 0, "Something weird :( ");
Expected behavior Seems like it shouldn't return any type arguments
This is all compiler api behaviour so it's probably working ok. Looks like the type argument passed down is the this type. I'll look into this more later.
this
Version: 2.2.0
Overview
Type#getTypeArguments() returns first subclass as instance of TypeParameter At least when it was got as ClassDeclaration#getExtends().getType()
Sampe
Expected behavior Seems like it shouldn't return any type arguments