Learn a little: Make metaprogramming possible in typescript class
So what is Metaprogramming?
It's the ability of a program to read, analyze, and change its form dynamically. A program that can write a program. It's Magic in programming, and you are the wizard!
The Challenge
It won't be much of a hassle to do metap...
blog.chiputera.com7 min read
The code called "The Solution" doesn't even pass typechecking for me.
Am I missing something?
sample.ts(11,11): error TS2310: Type 'BirdModel' recursively references itself as a base type. sample.ts(35,24): error TS2693: 'Bird' only refers to a type, but is being used as a value here. /private/tmp/sample.js:23 var littleBird = new Bird(mrPelican); ^
ReferenceError: Bird is not defined at Object.<anonymous> (/private/tmp/sample.js:23:18) at Module._compile (node:internal/modules/cjs/loader:1241:14) at Module._extensions..js (node:internal/modules/cjs/loader:1295:10) at Module.load (node:internal/modules/cjs/loader:1091:32) at Module._load (node:internal/modules/cjs/loader:938:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) at node:internal/main/run_main_module:23:47