bluenigma
bluenigma t1_je7z1k1 wrote
Reply to comment by xander76 in [P] Imaginary programming: implementation-free TypeScript functions for GPT-powered web development by xander76
Can you actually check the typescript-defined return type in that way nowadays? I thought that information was unavailable at runtime.
How does this handle type imports or advanced types?
bluenigma t1_je7r1ci wrote
Reply to comment by reditum in [P] Imaginary programming: implementation-free TypeScript functions for GPT-powered web development by xander76
Doesn't this also have pretty high risk of not actually adhering to the declared return type?
bluenigma t1_je84g9s wrote
Reply to comment by xander76 in [P] Imaginary programming: implementation-free TypeScript functions for GPT-powered web development by xander76
I guess I'm still wondering that if you can generate a runtime type check for an arbitrary Typescript type at compile time, why is this not a builtin Typescript language feature?
Edit: Took a quick look at the code and it it looks to me like there's definitely limitations on what return types are supported. Looks like it can handle basic aliases and record types, but throws on a lot of other stuff?
Should probably be documented somewhere.