prettier/tests/flow/poly_class_export/C.js

15 lines
240 B
JavaScript

// @flow
// This test exports a function whose return type is the class's `this` type.
// It should be inferred (no annotation required).
class Foo {
foo(): this {
return this;
}
}
export function f(x: Foo) {
return x.foo();
}