andreypopp / validated

Validate your configurations with precise error messages
91 stars 14 forks source link

Fix typings for Flow 0.54.0+ #14

Closed sleexyz closed 7 years ago

sleexyz commented 7 years ago

As of Flow 0.54.0, Flow has required that type parameters be annotated in class declarations, instead of left in "point-free" form.

From the Flow changelog:

Extending a polymorphic class must now explicitly specify the parent class's type args. 
That is, class A<T> {}; class B extends A {} is now an error,
but class C extends A<string> {} or class D<T> extends A<T> {} is ok.

This PR fixes the following error message, tested on flow 0.55.0:

Error: src/schema.js:390
390: export class OneOfNode extends Node {
                                    ^^^^ polymorphic type: class type: Node. Too few type arguments. Expected at least 1
128: export class Node<V> {
                       ^ See type parameters of definition here

Found 1 error
andreypopp commented 7 years ago

Thanks! Released as v1.1.1.