mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
31 lines
496 B
TypeScript
31 lines
496 B
TypeScript
// In this file:
|
|
// Assign to a module
|
|
// Assign to a class
|
|
// Assign to an enum
|
|
// Assign to a function
|
|
// Assign to a variable
|
|
// Assign to a parameter
|
|
// Assign to an interface
|
|
|
|
module M { }
|
|
M = null; // Error
|
|
|
|
class C { }
|
|
C = null; // Error
|
|
|
|
enum E { A }
|
|
E = null; // Error
|
|
E.A = null; // OK per spec, Error per implementation (509581)
|
|
|
|
function fn() { }
|
|
fn = null; // Should be error
|
|
|
|
var v;
|
|
v = null; // OK
|
|
|
|
function fn2(p) {
|
|
p = null; // OK
|
|
}
|
|
|
|
interface I { }
|
|
I = null; // Error
|