mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
where check stage, step 1: designators (#4329)
Right now, there is no checking of `where` requirements. The result of a where expression is just the type on the left-hand side. It does now introduce `.Self` so that it is available in expressions on the right-hand side, in addition to designators corresponding to the members of type on the left-hand side. Note, though, that diagnostics could still be improved significantly. --------- Co-authored-by: Josh L <josh11b@users.noreply.github.com> Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Josh L
Jon Ross-Perkins
parent
bba4f8aa20
commit
49a8efbe1b
@@ -443,11 +443,14 @@ class NodeStack {
|
||||
return Id::KindFor<SemIR::InterfaceId>();
|
||||
case Parse::NodeKind::ImplDefinitionStart:
|
||||
return Id::KindFor<SemIR::ImplId>();
|
||||
case Parse::NodeKind::SelfTypeName:
|
||||
case Parse::NodeKind::SelfValueName:
|
||||
return Id::KindFor<SemIR::NameId>();
|
||||
case Parse::NodeKind::DefaultLibrary:
|
||||
case Parse::NodeKind::LibraryName:
|
||||
return Id::KindFor<SemIR::LibraryNameId>();
|
||||
case Parse::NodeKind::WhereOperand:
|
||||
return Id::KindFor<SemIR::TypeId>();
|
||||
case Parse::NodeKind::ArrayExprSemi:
|
||||
case Parse::NodeKind::BuiltinName:
|
||||
case Parse::NodeKind::ClassIntroducer:
|
||||
@@ -623,7 +626,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::RequirementEqualEqual:
|
||||
case Parse::NodeKind::RequirementImpls:
|
||||
case Parse::NodeKind::ReturnStatement:
|
||||
case Parse::NodeKind::SelfTypeName:
|
||||
case Parse::NodeKind::SelfTypeNameExpr:
|
||||
case Parse::NodeKind::SelfValueNameExpr:
|
||||
case Parse::NodeKind::ShortCircuitOperatorAnd:
|
||||
@@ -643,7 +645,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::VariableDecl:
|
||||
case Parse::NodeKind::VirtualModifier:
|
||||
case Parse::NodeKind::WhereExpr:
|
||||
case Parse::NodeKind::WhereOperand:
|
||||
case Parse::NodeKind::WhileStatement:
|
||||
return Id::Kind::Invalid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user