-
Notifications
You must be signed in to change notification settings - Fork 53
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
Encode complex types in section mangling #1199
Conversation
15e599b
to
103a3e1
Compare
0c26c1c
to
be78df6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1199 +/- ##
==========================================
- Coverage 95.62% 91.11% -4.51%
==========================================
Files 150 153 +3
Lines 42657 44816 +2159
==========================================
+ Hits 40789 40833 +44
- Misses 1868 3983 +2115 ☔ View full report in Codecov by Sentry. |
// the same. Therefore, only encode it as its underlying type. | ||
DataTypeInformation::SubRange { referenced_type, .. } => access_inner(referenced_type)?, | ||
DataTypeInformation::Generic { .. } | DataTypeInformation::Alias { .. } => { | ||
// FIXME: Is that correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, generics and aliases will be resolved to the correct types during the resolve phase.
DataTypeInformation::Array { inner_type_name, .. } => { | ||
Type::Array { inner: Box::new(access_inner(inner_type_name)?) } | ||
} | ||
// FIXME: Is that correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the range is only relevant at compile time AFAIK.
Technically the norm allows for different runtime behaviour if a value is out of range, but this would still not affect the generated type, only some functions that the user needs to have.
The subrange has an implicit method that gives the upper and lower bounds but this is resolved on compile time as well since the range is known.
be78df6
to
a975ea3
Compare
a975ea3
to
54e08eb
Compare
@ghaith rebased properly, sorry for the confusion :) |
Needs #1198
This PR allows the section mangler to encode more type information in order to specify structs, enumerations, arrays and aliases. There are still some missing bits, e.g. regarding the length of arrays