1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "VariableDeclaration", 6 "declarations": [ 7 { 8 "type": "VariableDeclarator", 9 "id": { 10 "type": "Identifier", 11 "name": "a", 12 "typeAnnotation": { 13 "type": "TSUnionType", 14 "types": [ 15 { 16 "type": "TSTypeLiteral", 17 "members": [ 18 { 19 "type": "TSPropertySignature", 20 "computed": false, 21 "optional": false, 22 "readonly": false, 23 "key": { 24 "type": "Identifier", 25 "name": "a", 26 "decorators": [], 27 "loc": { 28 "start": { 29 "line": 17, 30 "column": 10 31 }, 32 "end": { 33 "line": 17, 34 "column": 11 35 } 36 } 37 }, 38 "typeAnnotation": { 39 "type": "TSNumberKeyword", 40 "loc": { 41 "start": { 42 "line": 17, 43 "column": 13 44 }, 45 "end": { 46 "line": 17, 47 "column": 19 48 } 49 } 50 }, 51 "loc": { 52 "start": { 53 "line": 17, 54 "column": 10 55 }, 56 "end": { 57 "line": 17, 58 "column": 20 59 } 60 } 61 }, 62 { 63 "type": "TSPropertySignature", 64 "computed": false, 65 "optional": false, 66 "readonly": false, 67 "key": { 68 "type": "Identifier", 69 "name": "b", 70 "decorators": [], 71 "loc": { 72 "start": { 73 "line": 17, 74 "column": 21 75 }, 76 "end": { 77 "line": 17, 78 "column": 22 79 } 80 } 81 }, 82 "typeAnnotation": { 83 "type": "TSStringKeyword", 84 "loc": { 85 "start": { 86 "line": 17, 87 "column": 24 88 }, 89 "end": { 90 "line": 17, 91 "column": 30 92 } 93 } 94 }, 95 "loc": { 96 "start": { 97 "line": 17, 98 "column": 21 99 }, 100 "end": { 101 "line": 17, 102 "column": 32 103 } 104 } 105 } 106 ], 107 "loc": { 108 "start": { 109 "line": 17, 110 "column": 8 111 }, 112 "end": { 113 "line": 17, 114 "column": 32 115 } 116 } 117 }, 118 { 119 "type": "TSTypeLiteral", 120 "members": [ 121 { 122 "type": "TSPropertySignature", 123 "computed": false, 124 "optional": false, 125 "readonly": false, 126 "key": { 127 "type": "Identifier", 128 "name": "a", 129 "decorators": [], 130 "loc": { 131 "start": { 132 "line": 17, 133 "column": 37 134 }, 135 "end": { 136 "line": 17, 137 "column": 38 138 } 139 } 140 }, 141 "typeAnnotation": { 142 "type": "TSStringKeyword", 143 "loc": { 144 "start": { 145 "line": 17, 146 "column": 40 147 }, 148 "end": { 149 "line": 17, 150 "column": 46 151 } 152 } 153 }, 154 "loc": { 155 "start": { 156 "line": 17, 157 "column": 37 158 }, 159 "end": { 160 "line": 17, 161 "column": 47 162 } 163 } 164 }, 165 { 166 "type": "TSPropertySignature", 167 "computed": false, 168 "optional": false, 169 "readonly": false, 170 "key": { 171 "type": "Identifier", 172 "name": "b", 173 "decorators": [], 174 "loc": { 175 "start": { 176 "line": 17, 177 "column": 48 178 }, 179 "end": { 180 "line": 17, 181 "column": 49 182 } 183 } 184 }, 185 "typeAnnotation": { 186 "type": "TSNumberKeyword", 187 "loc": { 188 "start": { 189 "line": 17, 190 "column": 51 191 }, 192 "end": { 193 "line": 17, 194 "column": 57 195 } 196 } 197 }, 198 "loc": { 199 "start": { 200 "line": 17, 201 "column": 48 202 }, 203 "end": { 204 "line": 17, 205 "column": 59 206 } 207 } 208 } 209 ], 210 "loc": { 211 "start": { 212 "line": 17, 213 "column": 35 214 }, 215 "end": { 216 "line": 17, 217 "column": 59 218 } 219 } 220 } 221 ], 222 "loc": { 223 "start": { 224 "line": 17, 225 "column": 8 226 }, 227 "end": { 228 "line": 17, 229 "column": 59 230 } 231 } 232 }, 233 "decorators": [], 234 "loc": { 235 "start": { 236 "line": 17, 237 "column": 5 238 }, 239 "end": { 240 "line": 17, 241 "column": 6 242 } 243 } 244 }, 245 "init": { 246 "type": "ObjectExpression", 247 "properties": [ 248 { 249 "type": "Property", 250 "method": false, 251 "shorthand": false, 252 "computed": false, 253 "key": { 254 "type": "Identifier", 255 "name": "a", 256 "decorators": [], 257 "loc": { 258 "start": { 259 "line": 17, 260 "column": 64 261 }, 262 "end": { 263 "line": 17, 264 "column": 65 265 } 266 } 267 }, 268 "value": { 269 "type": "BooleanLiteral", 270 "value": true, 271 "loc": { 272 "start": { 273 "line": 17, 274 "column": 67 275 }, 276 "end": { 277 "line": 17, 278 "column": 71 279 } 280 } 281 }, 282 "kind": "init", 283 "loc": { 284 "start": { 285 "line": 17, 286 "column": 64 287 }, 288 "end": { 289 "line": 17, 290 "column": 71 291 } 292 } 293 } 294 ], 295 "loc": { 296 "start": { 297 "line": 17, 298 "column": 62 299 }, 300 "end": { 301 "line": 17, 302 "column": 73 303 } 304 } 305 }, 306 "loc": { 307 "start": { 308 "line": 17, 309 "column": 5 310 }, 311 "end": { 312 "line": 17, 313 "column": 73 314 } 315 } 316 } 317 ], 318 "kind": "var", 319 "loc": { 320 "start": { 321 "line": 17, 322 "column": 1 323 }, 324 "end": { 325 "line": 17, 326 "column": 74 327 } 328 } 329 } 330 ], 331 "loc": { 332 "start": { 333 "line": 1, 334 "column": 1 335 }, 336 "end": { 337 "line": 17, 338 "column": 74 339 } 340 } 341} 342TypeError: Type 'boolean' is not assignable to type 'number | string'. [objectLiteralAssignability6.ts:17:64] 343