mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 02:29:04 +03:00
30 lines
453 B
TypeScript
30 lines
453 B
TypeScript
var a: number = null;
|
|
var b: boolean = null;
|
|
var c: string = null;
|
|
var d: void = null;
|
|
|
|
var e: typeof undefined = null;
|
|
e = null; // ok
|
|
|
|
enum E { A }
|
|
E.A = null; // error
|
|
|
|
class C { foo: string }
|
|
var f: C;
|
|
f = null; // ok
|
|
C = null; // error
|
|
|
|
interface I { foo: string }
|
|
var g: I;
|
|
g = null; // ok
|
|
I = null; // error
|
|
|
|
module M { export var x = 1; }
|
|
M = null; // error
|
|
|
|
var h: { f(): void } = null;
|
|
|
|
function i<T>(a: T) {
|
|
a = null;
|
|
}
|
|
i = null; // error
|