-
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
Toolchain crashes on interface redeclaration #4071
Comments
I believe this is the same issue described in #4080, the problem here is not the redefining, rather the The same error can be reproduced with a case even as simple as this: // --- a.carbon
library "a";
interface I;
// --- a.impl.carbon
impl library "a";
var i: I; The exact querying happens here: |
Querying a local constant with an invalid instruction triggers a crash, this will prevent self_param_id to be used unless it is defined. Fixes carbon-language#4071 and carbon-language#4080
- Covers the test cases in carbon-language#4071 and carbon-language#4080 - Importing declaration works without an issue - Importing, then defining the interface throws a duplicate declaration issue since it is not yet implemented.
…4137) Querying a local constant with an invalid instruction triggers a crash, this will prevent self_param_id to be used unless it is defined. Closes #4071 and #4080 This will only fix the crash. The scenario where a declaration-only interface is imported then defined still gives an error message, but it won't crash this time.
…arbon-language#4137) Querying a local constant with an invalid instruction triggers a crash, this will prevent self_param_id to be used unless it is defined. Closes carbon-language#4071 and carbon-language#4080 This will only fix the crash. The scenario where a declaration-only interface is imported then defined still gives an error message, but it won't crash this time.
Description of the bug:
The toolchain crashes if an interface is declared in an API file and redeclared in the corresponding impl file.
What did you do, or what's a simple way to reproduce the bug?
The following file_test input reproduces the issue:
What did you expect to happen?
I'm not sure whether this kind of thing should be valid, but I didn't expect it to crash.
What actually happened?
The compiler crashed.
Any other information, logs, or outputs that you want to share?
Here's the crash log:
The text was updated successfully, but these errors were encountered: