You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
the variable with type of generic Type doesn't work
The code causing the problem
interface IFoo<T> {}
class Foo<T> implements IFoo<T> {}
const foo = new Foo<number>();
console.log(getType(foo).name);//doesn't work and print "unknown" but should print "Foo" or something similar with c#
To Reproduce Steps to reproduce the behavior:
Build,
run,
see error...
Expected behavior
getType should return Type of variable with isGenericType==true and generic args [number]
The text was updated successfully, but these errors were encountered:
Hello,
tst-reflect version 0.x is deprecated; it has quite a lot of issues.
I did a huge refactor, 1.0-alpha which is a lot better, but for some reason your example does not work with the runtime getType(var) call. It works with the static getType<Foo<number>>() call.
Here is an example with the alpha version: https://stackblitz.com/edit/rttist-playground-2ee7rk?file=src%2Findex.ts
It should be possible to fix it.
Here is an example with the latest version (WIP) based on completely new system. (This example is using esbuild!) https://stackblitz.com/edit/rttist-playground-esbuild-with-plugin-sxzz4s?file=src%2Findex.ts
In this example it is working but the part working with generic types is WIP. It will log the base generic type definition, not the generic types "inherited" from the definition.
Describe the bug
the variable with type of generic Type doesn't work
The code causing the problem
To Reproduce
Steps to reproduce the behavior:
Expected behavior
getType should return Type of variable with isGenericType==true and generic args [number]
The text was updated successfully, but these errors were encountered: