mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 12:12:16 +03:00
26 lines
366 B
TypeScript
26 lines
366 B
TypeScript
|
var x = true;
|
||
|
|
||
|
var a: number = x;
|
||
|
var b: string = x;
|
||
|
var c: void = x;
|
||
|
var d: typeof undefined = x;
|
||
|
|
||
|
enum E { A }
|
||
|
var e: E = x;
|
||
|
|
||
|
class C { foo: string }
|
||
|
var f: C = x;
|
||
|
|
||
|
interface I { bar: string }
|
||
|
var g: I = x;
|
||
|
|
||
|
var h: { (): string } = x;
|
||
|
var h2: { toString(): string } = x; // no error
|
||
|
|
||
|
module M { export var a = 1; }
|
||
|
M = x;
|
||
|
|
||
|
function i<T>(a: T) {
|
||
|
a = x;
|
||
|
}
|
||
|
i = x;
|