mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
Basic lowering support for classes. (#3334)
Track the fields in a class, and generate a corresponding struct type as the object representation for the class. For now, we always use a pointer as the value representation for a class.
This commit is contained in:
@@ -126,8 +126,7 @@ auto DeclarationNameStack::UpdateScopeIfNeeded(NameContext& name_context)
|
||||
case SemIR::ClassDeclaration::Kind: {
|
||||
const auto& class_info = context_->classes().Get(
|
||||
resolved_node.As<SemIR::ClassDeclaration>().class_id);
|
||||
// TODO: Check that the class is complete rather than that it has a scope.
|
||||
if (class_info.scope_id.is_valid()) {
|
||||
if (class_info.is_defined()) {
|
||||
name_context.state = NameContext::State::Resolved;
|
||||
name_context.target_scope_id = class_info.scope_id;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user