This type represents the expression+type arguments you can get in a class or interface heritage clause section. For class-implements clauses, or interface-extends clauses, these expressions can only be identifiers or dotted names. For class extends clauses, these could be any expressions in the future. However, for now, we only support identifiers and dotted names.
83 lines
2.8 KiB
Text
83 lines
2.8 KiB
Text
=== tests/cases/compiler/aliasUsageInOrExpression_main.ts ===
|
|
import Backbone = require("aliasUsageInOrExpression_backbone");
|
|
>Backbone : typeof Backbone
|
|
|
|
import moduleA = require("aliasUsageInOrExpression_moduleA");
|
|
>moduleA : typeof moduleA
|
|
|
|
interface IHasVisualizationModel {
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
|
|
VisualizationModel: typeof Backbone.Model;
|
|
>VisualizationModel : typeof Backbone.Model
|
|
>Backbone : typeof Backbone
|
|
>Model : typeof Backbone.Model
|
|
}
|
|
var i: IHasVisualizationModel;
|
|
>i : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
|
|
var d1 = i || moduleA;
|
|
>d1 : IHasVisualizationModel
|
|
>i || moduleA : IHasVisualizationModel
|
|
>i : IHasVisualizationModel
|
|
>moduleA : typeof moduleA
|
|
|
|
var d2: IHasVisualizationModel = i || moduleA;
|
|
>d2 : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
>i || moduleA : IHasVisualizationModel
|
|
>i : IHasVisualizationModel
|
|
>moduleA : typeof moduleA
|
|
|
|
var d2: IHasVisualizationModel = moduleA || i;
|
|
>d2 : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
>moduleA || i : IHasVisualizationModel
|
|
>moduleA : typeof moduleA
|
|
>i : IHasVisualizationModel
|
|
|
|
var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA };
|
|
>e : { x: IHasVisualizationModel; }
|
|
>x : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
><{ x: IHasVisualizationModel }>null || { x: moduleA } : { x: IHasVisualizationModel; }
|
|
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
|
|
>x : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
>{ x: moduleA } : { x: typeof moduleA; }
|
|
>x : typeof moduleA
|
|
>moduleA : typeof moduleA
|
|
|
|
var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null;
|
|
>f : { x: IHasVisualizationModel; }
|
|
>x : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; }
|
|
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
|
|
>x : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
>{ x: moduleA } : { x: typeof moduleA; }
|
|
>x : typeof moduleA
|
|
>moduleA : typeof moduleA
|
|
|
|
=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts ===
|
|
export class Model {
|
|
>Model : Model
|
|
|
|
public someData: string;
|
|
>someData : string
|
|
}
|
|
|
|
=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts ===
|
|
import Backbone = require("aliasUsageInOrExpression_backbone");
|
|
>Backbone : typeof Backbone
|
|
|
|
export class VisualizationModel extends Backbone.Model {
|
|
>VisualizationModel : VisualizationModel
|
|
>Backbone : typeof Backbone
|
|
>Model : Backbone.Model
|
|
|
|
// interesting stuff here
|
|
}
|
|
|