TypeScript/tests/baselines/reference/importInTypePosition.types

50 lines
882 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/importInTypePosition.ts ===
module A {
2014-08-28 21:40:58 +02:00
>A : typeof A
2014-08-15 23:33:16 +02:00
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
}
export var Origin = new Point(0, 0);
>Origin : Point
>new Point(0, 0) : Point
>Point : typeof Point
}
// no code gen expected
module B {
2014-08-28 21:40:58 +02:00
>B : unknown
2014-08-15 23:33:16 +02:00
import a = A; //Error generates 'var <Alias> = <EntityName>;'
2014-08-28 21:40:58 +02:00
>a : typeof a
2014-08-25 19:36:12 +02:00
>A : typeof a
2014-08-15 23:33:16 +02:00
}
// no code gen expected
module C {
2014-08-28 21:40:58 +02:00
>C : typeof C
2014-08-15 23:33:16 +02:00
import a = A; //Error generates 'var <Alias> = <EntityName>;'
2014-08-28 21:40:58 +02:00
>a : typeof a
2014-08-25 19:36:12 +02:00
>A : typeof a
2014-08-15 23:33:16 +02:00
var m: typeof a;
2014-08-25 19:36:12 +02:00
>m : typeof a
>a : typeof a
2014-08-15 23:33:16 +02:00
var p: a.Point;
2014-08-25 19:36:12 +02:00
>p : a.Point
2014-08-28 21:40:58 +02:00
>a : unknown
2014-08-25 19:36:12 +02:00
>Point : a.Point
2014-08-15 23:33:16 +02:00
var p = { x: 0, y: 0 };
2014-08-25 19:36:12 +02:00
>p : a.Point
2014-08-15 23:33:16 +02:00
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>y : number
}