Commit c4124ad
committed
Fix panic on missing first segment in package path resolution
When resolving a multi-segment package path like `foo:bar/nonexistent.{a}`,
if the first segment is not found in the package definitions, the code
would unwrap None and panic. Now breaks out of the lookup loop when the
first segment is not found, falling through to the existing error
reporting that produces a clear error message.
Added a resolution test case for this scenario.1 parent e1e684a commit c4124ad
File tree
4 files changed
+20
-1
lines changed- crates/wac-parser
- src
- tests/resolution/fail
- missing-package-definition/foo
4 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2553 | 2553 | | |
2554 | 2554 | | |
2555 | 2555 | | |
2556 | | - | |
| 2556 | + | |
| 2557 | + | |
2557 | 2558 | | |
2558 | 2559 | | |
2559 | 2560 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments