Closed Raynos closed 4 years ago
Hi @Raynos
Hegel doesn't have any
type. (It has "unknown" instead which is equivalent of unknown
in TypeScript and mixed
in Flow.js.
But, you mentioned right, that inside d.ts
files we still have any
, because Hegel tries to fully understand Definition Language
.
But, in duration of the analysis of a d.ts
file - any
will be converted to unknown
and you will not have an ability to use it as any
in TypeScript.
Thank you for the question ^_^.
Converting any to unknown is a neat trick. I like it.
I’ve gone pretty far down the type inference hole with https://github.com/Raynos/jsig
I’m excited that someone else is making a pass at a sound system. I had to give up as I couldn’t figure out how to implement generics ...
@Raynos I interpret generic as a function at the type. Also, you can help us, if you are interested in building a static type checker with a sound type system. We will happy to a new contributor ^_^
I saw that the website documentation say that the type system has no "any" in it.
Then I read the type definition of the builtin
Array
( https://github.com/JSMonk/hegel/blob/master/packages/typings/standard/index.d.ts#L246 )And the
some()
method on the array hasany
for thethisArg
parameter.This looks like a contradiction.