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