mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:31:05 +01:00
Finish refactoring Push/Pop for stronger type handling. (#2987)
This adds a distinction between Unused and SoloParseNode, rather than equating the two. This is intended to help identify nodes which are getting pushed but maybe don't need to be. Not totally done because I want to adjust declaration name handling due to a quirk with how it mixes Name with Expression, but almost done. Once that's done the type punning will be completely gone.
This commit is contained in:
@@ -111,7 +111,7 @@ auto SemanticsHandleReturnType(SemanticsContext& context,
|
||||
ParseTree::Node parse_node) -> bool {
|
||||
// Propagate the type expression.
|
||||
auto [type_parse_node, type_node_id] =
|
||||
context.node_stack().PopWithParseNode<SemanticsNodeId>();
|
||||
context.node_stack().PopExpressionWithParseNode();
|
||||
auto cast_node_id = context.ExpressionAsType(type_parse_node, type_node_id);
|
||||
context.node_stack().Push(parse_node, cast_node_id);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user