Skip to content

Fix Result<T, E> type mismatch when E is a user enum - #11

Merged
Cod-e-Codes merged 1 commit into
mainfrom
fix/result-custom-enum-type-identity
Aug 12, 2026
Merged

Fix Result<T, E> type mismatch when E is a user enum#11
Cod-e-Codes merged 1 commit into
mainfrom
fix/result-custom-enum-type-identity

Conversation

@Cod-e-Codes

Copy link
Copy Markdown
Owner

Summary

  • resolve_type_name rewrites parser Struct names to Enum inside generic parameters (and other composite types), so Result<int, MyError> from a return type equals Result::Err(MyError::Bad).
  • Previously expected and actual printed identically (expected Result<int, MyError>, got Result<int, MyError>).
  • Integration test imports stdlib/result.ion and covers Ok, Err, and match; unit test uses a local Result to isolate substitution from imports.

Test plan

  • cargo fmt, clippy -D warnings, cargo test
  • tests/test_runner.sh (273/273)
  • Example ion-build for all 14 examples; non-interactive examples run

resolve_type_name now rewrites parser Struct names to Enum inside generic parameters so Result<int, MyError> from a return type equals Result::Err.
@Cod-e-Codes
Cod-e-Codes merged commit 12e7214 into main Aug 12, 2026
7 checks passed
@Cod-e-Codes
Cod-e-Codes deleted the fix/result-custom-enum-type-identity branch August 12, 2026 21:21
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.

1 participant