Skip to content

Add tests for Union(Array(T), None) index access in type checker#1407

Merged
harehare merged 3 commits intofix/type-inference-union-tuplefrom
copilot/sub-pr-1406
Mar 8, 2026
Merged

Add tests for Union(Array(T), None) index access in type checker#1407
harehare merged 3 commits intofix/type-inference-union-tuplefrom
copilot/sub-pr-1406

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

  • Analyze the Union branch in resolve_deferred_tuple_accesses (lib.rs:423-460)
  • Add tests for Union(Array(T), None) index access in type checker
  • Refactor individual test functions to rstest #[case] parameterized tests:
    • test_union_array_index_access — 4 cases (Array(Number)/None valid, Array(Number)/None type error, Array(String)/None valid, two-arrays union element type error)
    • test_union_tuple_index_access — 2 cases (Tuple/None index 0 valid, Tuple/None index 1 type error)
  • Verify all 52 tests pass

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add tests to improve type inference and error handling Add tests for Union(Array(T), None) index access in type checker Mar 8, 2026
@harehare
Copy link
Copy Markdown
Owner

harehare commented Mar 8, 2026

@copilot
Please refactor these to parameterized tests using rstest.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot
Please refactor these to parameterized tests using rstest.

Done in commit 2e5fc10. The 6 individual #[test] functions are now two #[rstest] groups:

  • test_union_array_index_access — 4 #[case]s using the default checker
  • test_union_tuple_index_access — 2 #[case]s using the tuple-mode checker

@harehare harehare marked this pull request as ready for review March 8, 2026 07:01
@harehare harehare merged commit ec43883 into fix/type-inference-union-tuple Mar 8, 2026
@harehare harehare deleted the copilot/sub-pr-1406 branch March 8, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants