Roven Gabriel
Roven Gabriel
I have updated my prototype to accept the first program of @ahejlsberg. The type guards where extended as such : For any predicate of the form `ident.prop === expr` with...
In this case ˋsˋ will be treated as `Really | ReallyReady` and indeed we can't do nothing more with it. For the sake of demonstration we can imagine this instead...
While working on `switch/case` guards, I have realized that my algorithm for `if-then-else` guards was wrong, it did not take into account variance of properties, only variance of record width....
Yep, they can be used with overloading, when running your simplified code through our prototype we get this : ``` Typescript type mouseEvents = "mouseup" | "mousedown" | "mousemove"; type...
@danielearwicker about your question on incompatible types, this is by design. The type inference for your field `kind` is done on the assignation and then the inferred type of the...
@teppeis , @yortus Actually, it's the same feature, the examples are very familiar since it's actually this issue that was cross posted on flow's github (https://github.com/facebook/flow/issues/135) completing an other proposal...
Yep, in the case of Typescript, we are already in a world where everything can be `null/undefined`, I don't see the need to treat this case differently. Moreover, it's very...
The second example does not seem to scale very well : ``` typescript class Node { isLeafNode(): this is LeafNode { throw new Error('abstract'); } isOtherNode(): this is OtherNode {...
Indeed its intent is indeed clearer. So I have two comments : 1) With the current compiler, we can leverage that everything is either "undefined" or something to create an...
Having taken a look at Flow, I think it would be more elegant with a little stronger type system and special types rather than an ad hoc type narrowing. What...