Index: pkg/compiler/lib/src/resolution/members.dart |
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart |
index 1aa2d17ebba2e53bce1bfa0248507f6d225fbb42..d2e2f6e35b5e6d7c288f7d2ebf6f4557a3bd046e 100644 |
--- a/pkg/compiler/lib/src/resolution/members.dart |
+++ b/pkg/compiler/lib/src/resolution/members.dart |
@@ -3658,9 +3658,9 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
} |
ResolutionResult visitRethrow(Rethrow node) { |
- if (!inCatchBlock) { |
+ if (!inCatchBlock && node.throwToken.stringValue == 'rethrow') { |
reporter.reportErrorMessage( |
- node, MessageKind.THROW_WITHOUT_EXPRESSION); |
+ node, MessageKind.RETHROW_OUTSIDE_CATCH); |
} |
return const NoneResult(); |
} |