Browse Source

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.
Jon Meow 4 years ago
parent
commit
066bf10df3
2 changed files with 2 additions and 1 deletions
  1. 1 0
      executable_semantics/ast/BUILD
  2. 1 1
      executable_semantics/ast/return_term.h

+ 1 - 0
executable_semantics/ast/BUILD

@@ -93,6 +93,7 @@ cc_library(
     name = "return_term",
     name = "return_term",
     hdrs = ["return_term.h"],
     hdrs = ["return_term.h"],
     deps = [
     deps = [
+        ":expression",
         ":source_location",
         ":source_location",
         "//common:check",
         "//common:check",
         "//common:ostream",
         "//common:ostream",

+ 1 - 1
executable_semantics/ast/return_term.h

@@ -10,13 +10,13 @@
 
 
 #include "common/check.h"
 #include "common/check.h"
 #include "common/ostream.h"
 #include "common/ostream.h"
+#include "executable_semantics/ast/expression.h"
 #include "executable_semantics/ast/source_location.h"
 #include "executable_semantics/ast/source_location.h"
 #include "executable_semantics/common/nonnull.h"
 #include "executable_semantics/common/nonnull.h"
 
 
 namespace Carbon {
 namespace Carbon {
 
 
 class Value;
 class Value;
-class Expression;
 
 
 // The syntactic representation of a function declaration's return type.
 // The syntactic representation of a function declaration's return type.
 // This syntax can take one of three forms:
 // This syntax can take one of three forms: