This syntax allows you to specify whether a type variable can appear in a covariant or contravariant position, and is super useful for, say, Promise. Right now this is hacked in jankily, but in the next major release we should stop using Identifier nodes for type parameters.
4 lines
64 B
JavaScript
4 lines
64 B
JavaScript
class C<+T, -U> {}
|
|
function f<+T, -U>() {}
|
|
type T<+T, -U> = {};
|