오류 메시지와 함께 실패 할 수있는 TypeScript 컴파일러를 안정적으로 얻을 수있는 시나리오를 발견했습니다. "내부 오류 : 재산 'publicMembers'의 값을 가져올 수 없습니다 :이 아주 잘 TypeScript compiler crash: publicMembers is null or undefined의 중복 될 수있다Typescript 컴파일러 오류 : "publicMembers '속성 값을 가져올 수 없습니다. 개체가 null이거나 정의되지 않음"
interface Callback { (data: any): void; }
class EventSource1 {
addEventHandler(callback: Callback): void { }
}
class EventSource2 {
onSomeEvent: Callback;
}
export class Controller {
constructor() {
var eventSource = new EventSource1();
// Commenting the next line will allow it to compile.
eventSource.addEventHandler(msg => this.handleEventFromSource1(msg));
}
private handleEventFromSource1(signalState) {
console.log('Handle event from source 1');
var eventSource2 = new EventSource2();
// Commenting the next line will allow it to compile.
eventSource2.onSomeEvent = msg => this.handleEventFromSource2(msg);
}
private handleEventFromSource2(event) {
console.log("Handling event from source 2.");
}
}
하지만 생식이 상당히입니다 : 개체가 null 또는
다음내 Repro.ts 파일의 "정의되지 덜 복잡한, 그래서 나는 어쨌든 가서 그것을 게시 할 줄 알았다.
의견이 있으십니까?
도움, 감사합니다. 그리고 내 제안보다. –