Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeChecker: make error message less confusing #3152

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

mvido
Copy link
Contributor

@mvido mvido commented Mar 25, 2022

Same error message was used for all struct-like types:

  • IR::Type_UnknownStruct
  • IR::Type_Struct
  • IR::Type_Header
  • IR::Type_HeaderUnion

In case of a header or header_union it could result in a message
like this:
"""
Field my_field is not a member of structure header my_header_h
"""
which might have been confusing for a user (why is error message
mentioning structure and header at one place?).

The word "structure" is now omitted in case of IR::Type_Header
and IR::Type_HeaderUnion.
String representation of IR::Type_Header and IR::Type_HeaderUnion
nodes used in this error message already contains also header or
header_union keyword.

Same error message was used for all struct-like types:
* IR::Type_UnknownStruct
* IR::Type_Struct
* IR::Type_Header
* IR::Type_HeaderUnion

In case of a header or header_union it could result in a message
like this:
"""
Field my_field is not a member of structure header my_header_h
"""
which might have been confusing for a user (why is error message
mentioning structure and header at one place?).

The word "structure" is now omitted in case of IR::Type_Header
and IR::Type_HeaderUnion.
String representation of IR::Type_Header and IR::Type_HeaderUnion
nodes used in this error message already contains also header or
header_union keyword.
@mvido mvido force-pushed the mvido/type_check_error_message branch from 299ea18 to 28643cd Compare March 25, 2022 17:35
@mvido mvido requested a review from mihaibudiu March 25, 2022 17:37
Copy link
Contributor

@jnfoster jnfoster left a comment

Choose a reason for hiding this comment

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

Nice! LGTM.

@mihaibudiu mihaibudiu merged commit 92df5da into main Mar 25, 2022
@mihaibudiu mihaibudiu deleted the mvido/type_check_error_message branch March 25, 2022 23:19
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