All the solutions I saw for the begginer challange had either a hardcoded shape for the three pumpkin types, or inferred them from the array, which also locked the Pumpkin type to only the existing combos. (So, no white ripe pumpkin can exist?)
I tried here to create freely combinable version, but it seems to only half worked. First, I had to Omit the soundWhenHit from the base type before I could create the filtering one, not sure why.
Second, the cookPumpkinSoup() still complains. I guess it can't now idetify the initial array as consising of Pumpkins? I'm a bit lost.
All the solutions I saw for the begginer challange had either a hardcoded shape for the three pumpkin types, or inferred them from the array, which also locked the Pumpkin type to only the existing combos. (So, no white ripe pumpkin can exist?)
I tried here to create freely combinable version, but it seems to only half worked. First, I had to
Omit
thesoundWhenHit
from the base type before I could create the filtering one, not sure why.Second, the
cookPumpkinSoup()
still complains. I guess it can't now idetify the initial array as consising of Pumpkins? I'm a bit lost.I feel ya' - I've added the next post in the series which covers our versions of the answers: dev.to/typescript/type-treat-2021-...