Use the position on as when issuing AssertAssignable for as
E.g. the following program gives a type error, but previously didn't
tell what line had an error. This CL fixes the issue.
```
import "dart:async";
Future<Object> foo() {
return Future.value("hello");
}
main() async {
int x = await foo();
}
```
Change-Id: I27ae483b8b7ca63b9efac555a5cbc651296f227a
Reviewed-on: https://dart-review.googlesource.com/68367
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 3ec8cb3..9744565 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -4019,8 +4019,7 @@
uint8_t flags = ReadFlags(); // read flags.
const bool is_type_error = (flags & (1 << 0)) != 0;
- TokenPosition value_position = TokenPosition::kNoSource;
- Fragment instructions = BuildExpression(&value_position); // read operand.
+ Fragment instructions = BuildExpression(); // read operand.
const AbstractType& type = T.BuildType(); // read type.
@@ -4041,7 +4040,7 @@
} else if (is_type_error) {
instructions += LoadLocal(MakeTemporary());
instructions += flow_graph_builder_->AssertAssignable(
- value_position, type, Symbols::Empty(),
+ position, type, Symbols::Empty(),
AssertAssignableInstr::kInsertedByFrontend);
instructions += Drop();
} else {