Lurker News

Comments (191) 32 threads

Show all comments

Showing thread 16 of 32

CGamesPlay2 replies#
Pretty interesting, but it doesn't seem to be possible to use the resulting values? Except as type declarations of course. Also, the playground link either fails (there are several errors) or doesn't produce any output.
phpnode#
hover over the type annotations to see results in the playground, that's the output :)

The errors aren't really errors, just warnings about unused types

amitport1 reply#
yeah Typescript is compile-time-only type system, you can only use it as a type. still cool though
ricksharp1 reply#
But if you declare a string literal as const, then the string runtime value will match the string type. So it would be possible to have a runtime result (that executes an actual db query for example) that is paired with the type result.
james-mcelwain2 replies#
No, TypeScript is compile time only. There's no runtime type info.

Continue this thread — 2 replies