1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "FunctionDeclaration", 6 "function": { 7 "type": "ScriptFunction", 8 "id": { 9 "type": "Identifier", 10 "name": "foo", 11 "decorators": [], 12 "loc": { 13 "start": { 14 "line": 17, 15 "column": 10 16 }, 17 "end": { 18 "line": 17, 19 "column": 13 20 } 21 } 22 }, 23 "generator": false, 24 "async": false, 25 "expression": false, 26 "params": [ 27 { 28 "type": "AssignmentPattern", 29 "left": { 30 "type": "Identifier", 31 "name": "undefined", 32 "typeAnnotation": { 33 "type": "TSStringKeyword", 34 "loc": { 35 "start": { 36 "line": 17, 37 "column": 26 38 }, 39 "end": { 40 "line": 17, 41 "column": 32 42 } 43 } 44 }, 45 "decorators": [], 46 "loc": { 47 "start": { 48 "line": 17, 49 "column": 15 50 }, 51 "end": { 52 "line": 17, 53 "column": 24 54 } 55 } 56 }, 57 "right": { 58 "type": "StringLiteral", 59 "value": "bar", 60 "loc": { 61 "start": { 62 "line": 17, 63 "column": 35 64 }, 65 "end": { 66 "line": 17, 67 "column": 40 68 } 69 } 70 }, 71 "loc": { 72 "start": { 73 "line": 17, 74 "column": 15 75 }, 76 "end": { 77 "line": 17, 78 "column": 40 79 } 80 } 81 } 82 ], 83 "returnType": { 84 "type": "TSNumberKeyword", 85 "loc": { 86 "start": { 87 "line": 17, 88 "column": 43 89 }, 90 "end": { 91 "line": 17, 92 "column": 49 93 } 94 } 95 }, 96 "body": { 97 "type": "BlockStatement", 98 "statements": [ 99 { 100 "type": "ReturnStatement", 101 "argument": { 102 "type": "Identifier", 103 "name": "undefined", 104 "decorators": [], 105 "loc": { 106 "start": { 107 "line": 18, 108 "column": 12 109 }, 110 "end": { 111 "line": 18, 112 "column": 21 113 } 114 } 115 }, 116 "loc": { 117 "start": { 118 "line": 18, 119 "column": 5 120 }, 121 "end": { 122 "line": 18, 123 "column": 22 124 } 125 } 126 } 127 ], 128 "loc": { 129 "start": { 130 "line": 17, 131 "column": 50 132 }, 133 "end": { 134 "line": 19, 135 "column": 2 136 } 137 } 138 }, 139 "loc": { 140 "start": { 141 "line": 17, 142 "column": 1 143 }, 144 "end": { 145 "line": 19, 146 "column": 2 147 } 148 } 149 }, 150 "loc": { 151 "start": { 152 "line": 17, 153 "column": 1 154 }, 155 "end": { 156 "line": 19, 157 "column": 2 158 } 159 } 160 }, 161 { 162 "type": "ExpressionStatement", 163 "expression": { 164 "type": "CallExpression", 165 "callee": { 166 "type": "Identifier", 167 "name": "foo", 168 "decorators": [], 169 "loc": { 170 "start": { 171 "line": 21, 172 "column": 1 173 }, 174 "end": { 175 "line": 21, 176 "column": 4 177 } 178 } 179 }, 180 "arguments": [], 181 "optional": false, 182 "loc": { 183 "start": { 184 "line": 21, 185 "column": 1 186 }, 187 "end": { 188 "line": 21, 189 "column": 6 190 } 191 } 192 }, 193 "loc": { 194 "start": { 195 "line": 21, 196 "column": 1 197 }, 198 "end": { 199 "line": 21, 200 "column": 7 201 } 202 } 203 } 204 ], 205 "loc": { 206 "start": { 207 "line": 1, 208 "column": 1 209 }, 210 "end": { 211 "line": 22, 212 "column": 1 213 } 214 } 215} 216TypeError: Type 'string' is not assignable to type 'number'. [undefined_variable_name.ts:18:5] 217