flowtypeが次のエラーを報告するのはなぜですか?また、これが期待どおりに動作するように文書化する必要があるのはなぜですか?単純なコンストラクタ関数のフロータイプエラー
index.js:7
4: console.log(MY_OBJECT.getName());
^^^^^^^ property `getName`. Property not found in
4: console.log(MY_OBJECT.getName());
^^^^^^^^^ new object
index.js
// @flow
import {MyObject} from './object';
const MY_OBJECT = new MyObject('name');
console.log(MY_OBJECT.getName());
object.js:
// @flow
export function MyObject(name: string) {
this._name = name;
this.getName = function(): string {return this._name;};
this.setName = function (name: string) {this._name = name;};
}