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:
josh11b
2024-09-25 02:44:12 +00:00
committed by GitHub
co-authored by Josh L Jon Ross-Perkins
parent bba4f8aa20
commit 49a8efbe1b
10 changed files with 1096 additions and 169 deletions
+3 -2
View File
@@ -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;
}