1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.ts ===
class C {
>C : C
foo: string;
>foo : string
}
var ac: C;
>ac : C
interface I {
foo: string;
>foo : string
}
var ai: I;
>ai : I
enum E { A }
>E : E
>A : E.A
var ae: E;
>ae : E
var b: number = null;
>b : number
>null : null
var c: string = null;
>c : string
>null : null
var d: boolean = null;
>d : boolean
>null : null
var e: Date = null;
>e : Date
>null : null
var f: any = null;
>f : any
>null : null
var g: void = null;
>g : void
>null : null
var h: Object = null;
>h : Object
>null : null
var i: {} = null;
>i : {}
>null : null
var j: () => {} = null;
>j : () => {}
>null : null
var k: Function = null;
>k : Function
>null : null
var l: (x: number) => string = null;
>l : (x: number) => string
>x : number
>null : null
ac = null;
>ac = null : null
>ac : C
>null : null
ai = null;
>ai = null : null
>ai : I
>null : null
ae = null;
>ae = null : null
>ae : E
>null : null
var m: number[] = null;
>m : number[]
>null : null
var n: { foo: string } = null;
>n : { foo: string; }
>foo : string
>null : null
var o: <T>(x: T) => T = null;
>o : <T>(x: T) => T
>x : T
>null : null
var p: Number = null;
>p : Number
>null : null
var q: String = null;
>q : String
>null : null
function foo<T, U, V extends Date>(x: T, y: U, z: V) {
>foo : <T, U, V extends Date>(x: T, y: U, z: V) => void
>x : T
>y : U
>z : V
x = null;
>x = null : null
>x : T
>null : null
y = null;
>y = null : null
>y : U
>null : null
z = null;
>z = null : null
>z : V
>null : null
}
//function foo<T, U extends T, V extends Date>(x: T, y: U, z: V) {
// x = null;
// y = null;
// z = null;
//}
|