Skip to content

refactor(diagnostics): Inlined error code implementation.#9299

Merged
orizi merged 1 commit intomainfrom
orizi/12-23-refactor_diagnostics_inlined_error_code_implementation
Dec 23, 2025
Merged

refactor(diagnostics): Inlined error code implementation.#9299
orizi merged 1 commit intomainfrom
orizi/12-23-refactor_diagnostics_inlined_error_code_implementation

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Dec 23, 2025

Summary

Refactored error code handling in semantic diagnostics by moving the error code logic from SemanticDiagnosticKind::error_code() directly into SemanticDiagnostic::error_code(). This eliminates the separate implementation on the kind enum while maintaining the same functionality.


Why is this change needed?

This refactoring simplifies the code structure by removing an unnecessary method implementation on SemanticDiagnosticKind and placing the error code logic directly where it's used in SemanticDiagnostic. This makes the code more maintainable by keeping related functionality together and reduces indirection.


What was the behavior or documentation before?

Previously, SemanticDiagnostic::error_code() delegated to SemanticDiagnosticKind::error_code(), creating an unnecessary layer of indirection.


What is the behavior or documentation after?

Now, SemanticDiagnostic::error_code() directly implements the error code mapping logic, eliminating the separate implementation on the kind enum while maintaining identical functionality.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

orizi commented Dec 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Collaborator

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@TomerStarkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi).

@orizi orizi added this pull request to the merge queue Dec 23, 2025
Merged via the queue into main with commit 1feaef7 Dec 23, 2025
54 checks passed
@orizi orizi deleted the orizi/12-23-refactor_diagnostics_inlined_error_code_implementation branch December 24, 2025 08:56
Princetimix69 pushed a commit to Princetimix69/cairo that referenced this pull request Jan 5, 2026
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.

3 participants