Hacker News new | past | comments | ask | show | jobs | submit login
FizzBuzz in TypeScript (typescriptlang.org)
3 points by johnnypangs on June 28, 2022 | hide | past | favorite | 10 comments



I get...

    This version of TypeScript (4.7.4#code/C4TwDgpgB[...]t7yAA) has not been prepared for the Playground
It seems to be a problem with the encoding of # and / in the URL. Possibly other characters.

Still, when fixing that, I get an Error:

    Type instantiation is excessively deep and possibly infinite.
On this line:

    type FizzBuzz = From0To99<[0, 0], []>;
So you may want to check that, if you think it's actually worth it.


And here is a new link with the error fixed: https://www.typescriptlang.org/play?ts=4.7.4#code/C4TwDgpgBA...


The error is still there, I'm afraid.



The error about excessive/infinite type instantiation depth is still there.

I mean, yes, it does "work" and FizzBuzz gets defined as expected. But... the error...



All the distraction aside, that's pretty neat.


Yes. It's fixed in this one.


Also, I didn't mention it but the FizzBuzz happens on hover of FizzBuzz. I realize that's not great behavior though


Can confirm.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: