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;};
}