Index: pkg/compiler/lib/src/kernel/kernel_visitor.dart |
diff --git a/pkg/compiler/lib/src/kernel/kernel_visitor.dart b/pkg/compiler/lib/src/kernel/kernel_visitor.dart |
index 30d1ead5f547bc9a3eb1f6e1838cf4d53c214a95..b889af3c53f77481eb3fa1f1badf50f868307146 100644 |
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart |
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart |
@@ -1011,10 +1011,13 @@ class KernelVisitor extends Object |
@override |
ir.SwitchCase visitSwitchCase(SwitchCase node) { |
List<ir.Expression> expressions = <ir.Expression>[]; |
+ List<int> expressionOffsets = <int>[]; |
for (var labelOrCase in node.labelsAndCases.nodes) { |
CaseMatch match = labelOrCase.asCaseMatch(); |
if (match != null) { |
- expressions.add(visitForValue(match.expression)); |
+ ir.TreeNode expression = visitForValue(match.expression); |
+ expressions.add(expression); |
+ expressionOffsets.add(expression.fileOffset); |
} else { |
// Assert that labelOrCase is one of two known types: [CaseMatch] or |
// [Label]. We ignore cases, as any users have been resolved to use the |
@@ -1025,7 +1028,8 @@ class KernelVisitor extends Object |
// We ignore the node's statements here, they're generated below in |
// [visitSwitchStatement] once we've set up all the jump targets. |
return associateNode( |
- new ir.SwitchCase(expressions, null, isDefault: node.isDefaultCase), |
+ new ir.SwitchCase(expressions, expressionOffsets, null, |
+ isDefault: node.isDefaultCase), |
node); |
} |