|
| 1 | +tests/cases/conformance/pragma/strictNullChecks/file1.ts(9,14): error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 2 | +tests/cases/conformance/pragma/strictNullChecks/file1.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 3 | +tests/cases/conformance/pragma/strictNullChecks/file1.ts(16,20): error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 4 | +tests/cases/conformance/pragma/strictNullChecks/file1.ts(25,1): error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 5 | +tests/cases/conformance/pragma/strictNullChecks/file1.ts(31,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 6 | +tests/cases/conformance/pragma/strictNullChecks/file2.ts(18,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 7 | + Types of property 'member' are incompatible. |
| 8 | + Type 'string | undefined' is not assignable to type 'string'. |
| 9 | + Type 'undefined' is not assignable to type 'string'. |
| 10 | +tests/cases/conformance/pragma/strictNullChecks/file2.ts(24,1): error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 11 | + Types of property 'member' are incompatible. |
| 12 | + Type 'string | undefined' is not assignable to type 'string'. |
| 13 | + Type 'undefined' is not assignable to type 'string'. |
| 14 | +tests/cases/conformance/pragma/strictNullChecks/file2.ts(27,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 15 | + Types of property 'member' are incompatible. |
| 16 | + Type 'string | undefined' is not assignable to type 'string'. |
| 17 | + Type 'undefined' is not assignable to type 'string'. |
| 18 | +tests/cases/conformance/pragma/strictNullChecks/file3.ts(5,14): error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 19 | +tests/cases/conformance/pragma/strictNullChecks/file3.ts(7,16): error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 20 | +tests/cases/conformance/pragma/strictNullChecks/file3.ts(8,16): error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 21 | +tests/cases/conformance/pragma/strictNullChecks/file3.ts(10,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 22 | +tests/cases/conformance/pragma/strictNullChecks/file3.ts(20,1): error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 23 | +tests/cases/conformance/pragma/strictNullChecks/file3.ts(26,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 24 | +tests/cases/conformance/pragma/strictNullChecks/file4.ts(10,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 25 | +tests/cases/conformance/pragma/strictNullChecks/file4.ts(20,1): error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 26 | +tests/cases/conformance/pragma/strictNullChecks/file4.ts(26,1): error TS2322: Type 'B' is not assignable to type 'A'. |
| 27 | + |
| 28 | + |
| 29 | +==== tests/cases/conformance/pragma/strictNullChecks/file1.ts (5 errors) ==== |
| 30 | + // @ts-strictNullChecks |
| 31 | + export interface A { |
| 32 | + member: string; |
| 33 | + } |
| 34 | + export interface B { |
| 35 | + member: string | undefined; |
| 36 | + } |
| 37 | + |
| 38 | + let a: A = { member: undefined }; |
| 39 | + ~~~~~~ |
| 40 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 41 | +!!! related TS6500 tests/cases/conformance/pragma/strictNullChecks/file1.ts:3:5: The expected type comes from property 'member' which is declared here on type 'A' |
| 42 | + declare var b: B; |
| 43 | + a = b; |
| 44 | + ~ |
| 45 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 46 | + b = a; |
| 47 | + |
| 48 | + import {A as OtherA, B as OtherB} from "./file2"; |
| 49 | + |
| 50 | + let a2: OtherA = { member: undefined }; |
| 51 | + ~~~~~~ |
| 52 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 53 | +!!! related TS6500 /.src/tests/cases/conformance/pragma/strictNullChecks/file2.ts:3:5: The expected type comes from property 'member' which is declared here on type 'A' |
| 54 | + declare var b2: OtherB; |
| 55 | + a2 = b2; |
| 56 | + b2 = a2; |
| 57 | + |
| 58 | + a = a2; |
| 59 | + a2 = a; |
| 60 | + |
| 61 | + b = b2; |
| 62 | + b2 = b; |
| 63 | + ~~ |
| 64 | +!!! error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 65 | + |
| 66 | + a = b2; |
| 67 | + b2 = a; |
| 68 | + |
| 69 | + b = a2; |
| 70 | + a2 = b; |
| 71 | + ~~ |
| 72 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 73 | + |
| 74 | +==== tests/cases/conformance/pragma/strictNullChecks/file2.ts (3 errors) ==== |
| 75 | + // loose |
| 76 | + export interface A { |
| 77 | + member: string; |
| 78 | + } |
| 79 | + export interface B { |
| 80 | + member: string | undefined; |
| 81 | + } |
| 82 | + |
| 83 | + let a: A = { member: undefined }; |
| 84 | + declare var b: B; |
| 85 | + a = b; |
| 86 | + b = a; |
| 87 | + |
| 88 | + import {A as OtherA, B as OtherB} from "./file1"; |
| 89 | + |
| 90 | + let a2: OtherA = { member: undefined }; |
| 91 | + declare var b2: OtherB; |
| 92 | + a2 = b2; |
| 93 | + ~~ |
| 94 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 95 | +!!! error TS2322: Types of property 'member' are incompatible. |
| 96 | +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. |
| 97 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 98 | + b2 = a2; |
| 99 | + |
| 100 | + a = a2; |
| 101 | + a2 = a; |
| 102 | + |
| 103 | + b = b2; |
| 104 | + ~ |
| 105 | +!!! error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 106 | +!!! error TS2322: Types of property 'member' are incompatible. |
| 107 | +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. |
| 108 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 109 | + b2 = b; |
| 110 | + |
| 111 | + a = b2; |
| 112 | + ~ |
| 113 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 114 | +!!! error TS2322: Types of property 'member' are incompatible. |
| 115 | +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. |
| 116 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 117 | + b2 = a; |
| 118 | + |
| 119 | + b = a2; |
| 120 | + a2 = b; |
| 121 | + |
| 122 | +==== tests/cases/conformance/pragma/strictNullChecks/file3.ts (6 errors) ==== |
| 123 | + // @ts-strictNullChecks |
| 124 | + import {A, B} from "./file1"; |
| 125 | + import {A as A2, B as B2} from "./file2"; |
| 126 | + |
| 127 | + let a: A = { member: undefined }; |
| 128 | + ~~~~~~ |
| 129 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 130 | +!!! related TS6500 tests/cases/conformance/pragma/strictNullChecks/file1.ts:3:5: The expected type comes from property 'member' which is declared here on type 'A' |
| 131 | + let b: B = { member: undefined }; |
| 132 | + let a2: A2 = { member: undefined }; |
| 133 | + ~~~~~~ |
| 134 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 135 | +!!! related TS6500 /.src/tests/cases/conformance/pragma/strictNullChecks/file2.ts:3:5: The expected type comes from property 'member' which is declared here on type 'A' |
| 136 | + let b2: B2 = { member: undefined }; |
| 137 | + ~~~~~~ |
| 138 | +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. |
| 139 | +!!! related TS6500 /.src/tests/cases/conformance/pragma/strictNullChecks/file2.ts:6:5: The expected type comes from property 'member' which is declared here on type 'B' |
| 140 | + |
| 141 | + a = b; |
| 142 | + ~ |
| 143 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 144 | + b = a; |
| 145 | + |
| 146 | + a2 = b2; |
| 147 | + b2 = a2; |
| 148 | + |
| 149 | + a = a2; |
| 150 | + a2 = a; |
| 151 | + |
| 152 | + b = b2; |
| 153 | + b2 = b; |
| 154 | + ~~ |
| 155 | +!!! error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 156 | + |
| 157 | + a = b2; |
| 158 | + b2 = a; |
| 159 | + |
| 160 | + b = a2; |
| 161 | + a2 = b; |
| 162 | + ~~ |
| 163 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 164 | + |
| 165 | +==== tests/cases/conformance/pragma/strictNullChecks/file4.ts (3 errors) ==== |
| 166 | + // loose |
| 167 | + import {A, B} from "./file1"; |
| 168 | + import {A as A2, B as B2} from "./file2"; |
| 169 | + |
| 170 | + let a: A = { member: undefined }; |
| 171 | + let b: B = { member: undefined }; |
| 172 | + let a2: A2 = { member: undefined }; |
| 173 | + let b2: B2 = { member: undefined }; |
| 174 | + |
| 175 | + a = b; |
| 176 | + ~ |
| 177 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
| 178 | + b = a; |
| 179 | + |
| 180 | + a2 = b2; |
| 181 | + b2 = a2; |
| 182 | + |
| 183 | + a = a2; |
| 184 | + a2 = a; |
| 185 | + |
| 186 | + b = b2; |
| 187 | + b2 = b; |
| 188 | + ~~ |
| 189 | +!!! error TS2322: Type 'import("tests/cases/conformance/pragma/strictNullChecks/file1").B' is not assignable to type 'import("tests/cases/conformance/pragma/strictNullChecks/file2").B'. |
| 190 | + |
| 191 | + a = b2; |
| 192 | + b2 = a; |
| 193 | + |
| 194 | + b = a2; |
| 195 | + a2 = b; |
| 196 | + ~~ |
| 197 | +!!! error TS2322: Type 'B' is not assignable to type 'A'. |
0 commit comments