//// [genericCallbacksAndClassHierarchy.ts] module M { export interface I { subscribe(callback: (newValue: T) => void ): any; } export class C1 { public value: I; } export class A { public dummy: any; } export class B extends C1> { } export class D { _subscribe(viewModel: B): void { var f = (newValue: A) => { }; var v: I> = viewModel.value; // both of these should work v.subscribe(f); v.subscribe((newValue: A) => { }); } } } //// [genericCallbacksAndClassHierarchy.js] var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var M; (function (M) { var C1 = (function () { function C1() { } return C1; })(); M.C1 = C1; var A = (function () { function A() { } return A; })(); M.A = A; var B = (function (_super) { __extends(B, _super); function B() { _super.apply(this, arguments); } return B; })(C1); M.B = B; var D = (function () { function D() { } D.prototype._subscribe = function (viewModel) { var f = function (newValue) { }; var v = viewModel.value; // both of these should work v.subscribe(f); v.subscribe(function (newValue) { }); }; return D; })(); M.D = D; })(M || (M = {}));