-
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
Fuzzer issue: extending a member class as a base class #2994
Labels
explorer
Action items related to Carbon explorer code
Comments
josh11b
added a commit
to josh11b/carbon-lang
that referenced
this issue
Jul 18, 2023
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 24, 2023
…2994 (#2995) Closes #2994 --------- Co-authored-by: Geoff Romer <[email protected]>
chandlerc
pushed a commit
to chandlerc/carbon-lang
that referenced
this issue
Jul 25, 2023
…arbon-language#2994 (carbon-language#2995) Closes carbon-language#2994 --------- Co-authored-by: Geoff Romer <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the bug:
Proposal #2760 moved the declaration of a base class from the class declaration line into the body of the class definition. This change was implemented in Explorer in #2906 . However, this change did not account for the consequence of this change that the base class expression could now refer to something declared earlier in class scope. The implementation in #2906 of
TypeChecker::DeclareClassDeclaration(...)
inexplorer/interpreter/type_checker.cpp
type checks the base class expression beforeDeclareDeclaration(...)
can be called on the members. If the base class expression contains a reference to a member (such as a member class), it fails when it tries to access that member'sstatic_type
, which hasn't been set yet.Unfortunately, this code is difficult to reorder, since the members can refer to
Self
which is aNominalClassType
created in this function, withbase_class
as a parameter, which we don't know until we've processed theextend base
declaration.What did you do, or what's a simple way to reproduce the bug?
This triggers the bug:
This does not:
What did you expect to happen?
No crash. This code should instead produce some compilation error about trying to extend a class that is final.
What actually happened?
Crash:
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: