fix nondeterministic diagnostic message ordering in tests
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 218
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 8
Description
Some cases:
```
Input file: fixtures/ty_check/method_selection/require_explicit_import.fe
──────────────────────────────────────────────────────────────────────────
Expression: diags
──────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬─────────────────────────────────────────────────────────────
3 3 │ 2 │ x.foo()
4 4 │ │ ^^^
5 5 │ │ │
6 6 │ │ consider importing one of the following traits into the scope to resolve the ambiguity
7 │- │ `use require_explicit_import::inner::Bar`
8 │- │ `use require_explicit_import::inner::Foo`
7 │+ │ `use require_explicit_import::inner::Foo`
8 │+ │ `use require_explicit_import::inner::Bar`
```
```
Input file: fixtures/ty_check/method_selection/ambiguous_trait_def.fe
──────────────────────────────────────────────────────────────────────────
Expression: diags
──────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬─────────────────────────────────────────────────────────────
3 3 │ 38 │ let y = f.foo()
4 4 │ │ ^^^
5 5 │ │ │
6 6 │ │ `foo` is ambiguous
7 │+ │ candidate: `Trait2::foo`
7 8 │ │ candidate: `Trait1::foo`
8 │- │ candidate: `Trait2::foo`
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the diagnostic snapshots under fixtures/ty_check/method_selection/require_explicit_import.fe and ambiguous_trait_def.fe, then trace the code that produces the candidate and trait-import diagnostic lists. Run the affected type-checking fixture tests and make their output ordering deterministic so both snapshots pass consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100