pk19604014 4 éve
szülő
commit
34d128783f

+ 1 - 1
common/fuzzing/carbon.proto

@@ -258,7 +258,7 @@ message Statement {
     MatchStatement match = 8;
     ContinuationStatement continuation = 9;
     RunStatement run = 10;
-    AwaitStatement await = 11;
+    AwaitStatement await_statement = 11;
     BreakStatement break_statement = 12;
     ContinueStatement continue_statement = 13;
   }

+ 2 - 2
common/fuzzing/proto_to_carbon.cpp

@@ -88,7 +88,7 @@ static auto PrimitiveOperatorToCarbon(
     const Fuzzing::PrimitiveOperatorExpression& primitive_operator,
     llvm::raw_ostream& out) -> void {
   const Fuzzing::Expression& arg0 =
-      primitive_operator.arguments().size() > 0
+      !primitive_operator.arguments().empty()
           ? primitive_operator.arguments(0)
           : Fuzzing::Expression::default_instance();
   const Fuzzing::Expression& arg1 =
@@ -536,7 +536,7 @@ static auto StatementToCarbon(const Fuzzing::Statement& statement,
       break;
     }
 
-    case Fuzzing::Statement::kAwait:
+    case Fuzzing::Statement::kAwaitStatement:
       out << "__await;";
       break;
 

+ 1 - 1
executable_semantics/fuzzing/ast_to_proto.cpp

@@ -421,7 +421,7 @@ static auto StatementToProto(const Statement& statement) -> Fuzzing::Statement {
 
     case StatementKind::Await:
       // Initializes with the default value; there's nothing to set.
-      statement_proto.mutable_await();
+      statement_proto.mutable_await_statement();
       break;
 
     case StatementKind::Break:

+ 1 - 1
executable_semantics/interpreter/impl_scope.cpp

@@ -84,7 +84,7 @@ auto ImplScope::ResolveHere(Nonnull<const Value*> iface_type,
 void ImplScope::Print(llvm::raw_ostream& out) const {
   out << "impls: ";
   llvm::ListSeparator sep;
-  for (Impl impl : impls_) {
+  for (const Impl& impl : impls_) {
     out << sep << *(impl.type) << " as " << *(impl.interface);
   }
   out << "\n";

+ 3 - 3
executable_semantics/interpreter/type_checker.cpp

@@ -1440,14 +1440,14 @@ auto TypeChecker::ExpectReturnOnAllPaths(
 // TODO: Add checking to function definitions to ensure that
 //   all deduced type parameters will be deduced.
 auto TypeChecker::DeclareFunctionDeclaration(Nonnull<FunctionDeclaration*> f,
-                                             const ImplScope& impl_scope)
+                                             const ImplScope& enclosing_scope)
     -> ErrorOr<Success> {
   if (trace_) {
     llvm::outs() << "** declaring function " << f->name() << "\n";
   }
   // Bring the deduced parameters into scope
   for (Nonnull<GenericBinding*> deduced : f->deduced_parameters()) {
-    RETURN_IF_ERROR(TypeCheckExp(&deduced->type(), impl_scope));
+    RETURN_IF_ERROR(TypeCheckExp(&deduced->type(), enclosing_scope));
     deduced->set_symbolic_identity(arena_->New<VariableType>(deduced));
     ASSIGN_OR_RETURN(Nonnull<const Value*> type_of_type,
                      InterpExp(&deduced->type(), arena_, trace_));
@@ -1464,7 +1464,7 @@ auto TypeChecker::DeclareFunctionDeclaration(Nonnull<FunctionDeclaration*> f,
   }
   // Bring the impl bindings into scope.
   ImplScope function_scope;
-  function_scope.AddParent(&impl_scope);
+  function_scope.AddParent(&enclosing_scope);
   for (Nonnull<const ImplBinding*> impl_binding : impl_bindings) {
     CHECK(impl_binding->type_var()->symbolic_identity().has_value());
     function_scope.Add(impl_binding->interface(),