Commit 4d5dac8
committed
Preserve runtime error node IDs from Resolve
When absoluteAttribute.Resolve() encounters a *types.Err variable value,
return it directly rather than calling Unwrap(). The Unwrap call strips
the Err wrapper and its node ID, causing callers to re-label the error
with the observation site's ID instead of the originating expression's ID.
Additionally, avoid double-wrapping *types.Err values returned from
Resolve in evalTestOnly, evalAttr, and evalExhaustiveConditional. When
the error is already a *types.Err, pass it to LabelErrNode directly so
that a pre-existing non-zero node ID is preserved.
Fixes #11911 parent d19e782 commit 4d5dac8
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
1174 | 1177 | | |
1175 | 1178 | | |
1176 | 1179 | | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1177 | 1183 | | |
1178 | 1184 | | |
1179 | 1185 | | |
1180 | 1186 | | |
1181 | 1187 | | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1182 | 1191 | | |
1183 | 1192 | | |
1184 | 1193 | | |
| |||
1219 | 1228 | | |
1220 | 1229 | | |
1221 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1222 | 1234 | | |
1223 | 1235 | | |
1224 | 1236 | | |
| |||
0 commit comments