TypeScript/tests/cases/compiler/noCrashOnThisTypeUsage.ts
Wesley Wigham 4a6888a850
There exist type parameters with symbols but without TypeParameterDeclaration nodes (#23690)
* There exist type parameters with symbols but without TypeParameterDeclaration nodes

* Add test
2018-04-25 15:53:06 -07:00

26 lines
708 B
TypeScript

// @strict: true
interface IListenable {
changeListeners: Function[] | null
observe(handler: (change: any, oldValue?: any) => void, fireImmediately?: boolean): void
}
function notifyListeners<T>(listenable: IListenable, change: T) {
}
export class ObservableValue<T> {
constructor(
public value: T
) {
const newValue: T = value;
const oldValue: any = null;
notifyListeners(this, {
type: "update",
object: this,
newValue,
oldValue
});
}
changeListeners: Function[] | null = [];
observe(handler: (change: any, oldValue?: any) => void, fireImmediately?: boolean) {}
}