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
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