From 066bf10df3870c051dc4752f5199ddfca77ff97f Mon Sep 17 00:00:00 2001 From: Jon Meow <46229924+jonmeow@users.noreply.github.com> Date: Fri, 18 Feb 2022 16:35:39 -0800 Subject: [PATCH] Fix return_term dep on Expression (#1091) Line 91 has: ``` source_loc_(type_expression->source_loc()) {} ``` Which requires the Expression definition. This probably compiles accidentally due to #include ordering, but I ran into a case that needs correct #includes. --- executable_semantics/ast/BUILD | 1 + executable_semantics/ast/return_term.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/executable_semantics/ast/BUILD b/executable_semantics/ast/BUILD index 7f85ea2d5c6b..951eddc24365 100644 --- a/executable_semantics/ast/BUILD +++ b/executable_semantics/ast/BUILD @@ -93,6 +93,7 @@ cc_library( name = "return_term", hdrs = ["return_term.h"], deps = [ + ":expression", ":source_location", "//common:check", "//common:ostream", diff --git a/executable_semantics/ast/return_term.h b/executable_semantics/ast/return_term.h index bc48eaf9b5cd..9401f106de37 100644 --- a/executable_semantics/ast/return_term.h +++ b/executable_semantics/ast/return_term.h @@ -10,13 +10,13 @@ #include "common/check.h" #include "common/ostream.h" +#include "executable_semantics/ast/expression.h" #include "executable_semantics/ast/source_location.h" #include "executable_semantics/common/nonnull.h" namespace Carbon { class Value; -class Expression; // The syntactic representation of a function declaration's return type. // This syntax can take one of three forms: