-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Convert array bounds to IntLiteral
.
#4526
Convert array bounds to IntLiteral
.
#4526
Conversation
Depends on #4525. Review only the last commit here. |
sized integer types. In preparation for changing integer literals to be of `IntLiteral` type. Conversions from the integer literal type are only permitted when the value fits within the destination type. For now, if conversion cannot be checked because the source value is a symbolic constant, produce a symbolic constant representing the conversion rather than rejecting it.
3964c95
to
3a61b81
Compare
Don't hold a Function& after it may have been invalidated by importing.
3a61b81
to
eb99749
Compare
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.
Should we be trying to reduce the noise in these imports? This seems to be 700 lines per test file using i32 (I'm guessing 10-20 KB?), repeated per-test for split files (e.g., see the delta for array.carbon). Also, presumably will increase churn when an interface is added. I think there's some benefit to the full representation, but this is big enough that I'm wondering if we should be more concerned about long-term repo size issues.
The basics of this PR seem okay, but what's the filesize of the 80K line delta?
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.
Approving but not merging. The changes here seem fine to me, and I think my one concern will be addressed through #4534.
Instead of leaving array bounds as whatever integer type they arrive as, convert them to the
IntLiteral
type as part of forming anArrayType
. This ensures that array types canonicalize properly even when the bounds are specified with different types.Create an empty generic definition for a generic builtin function to avoid this causing "use of undefined generic function" errors.