-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Currently it seems that you can only annotate the this
magic reference by putting the function as a method in a class declaration.
However, in the light of the new bind syntax proposal, it would make sense to be able to annotate functions that take in this
as data, e.g.
function head (count) {
return this.slice(0, count);
}
[1,2,3]::head(2) // [1,2]
could be annotated something like:
function head <T> Array<T> -> (count : number) : Array<T> {
...
}
tlrobinson, iclanzan, achepukov, goodmind and eilvelia