63 lines
1.3 KiB
Plaintext
63 lines
1.3 KiB
Plaintext
=== tests/cases/compiler/specializedInheritedConstructors1.ts ===
|
|
interface ViewOptions<TModel> {
|
|
>ViewOptions : ViewOptions<TModel>
|
|
>TModel : TModel
|
|
|
|
model: TModel;
|
|
>model : TModel
|
|
>TModel : TModel
|
|
}
|
|
|
|
class View<TModel> {
|
|
>View : View<TModel>
|
|
>TModel : TModel
|
|
|
|
constructor(options: ViewOptions<TModel>) { }
|
|
>options : ViewOptions<TModel>
|
|
>ViewOptions : ViewOptions<TModel>
|
|
>TModel : TModel
|
|
|
|
model: TModel;
|
|
>model : TModel
|
|
>TModel : TModel
|
|
}
|
|
|
|
class Model { }
|
|
>Model : Model
|
|
|
|
class MyView extends View<Model> { }
|
|
>MyView : MyView
|
|
>View : View<Model>
|
|
>Model : Model
|
|
|
|
var m: ViewOptions<Model> = { model: new Model() };
|
|
>m : ViewOptions<Model>
|
|
>ViewOptions : ViewOptions<TModel>
|
|
>Model : Model
|
|
>{ model: new Model() } : { model: Model; }
|
|
>model : Model
|
|
>new Model() : Model
|
|
>Model : typeof Model
|
|
|
|
var aView = new View({ model: new Model() });
|
|
>aView : View<Model>
|
|
>new View({ model: new Model() }) : View<Model>
|
|
>View : typeof View
|
|
>{ model: new Model() } : { model: Model; }
|
|
>model : Model
|
|
>new Model() : Model
|
|
>Model : typeof Model
|
|
|
|
var aView2 = new View(m);
|
|
>aView2 : View<Model>
|
|
>new View(m) : View<Model>
|
|
>View : typeof View
|
|
>m : ViewOptions<Model>
|
|
|
|
var myView = new MyView(m); // was error
|
|
>myView : MyView
|
|
>new MyView(m) : MyView
|
|
>MyView : typeof MyView
|
|
>m : ViewOptions<Model>
|
|
|