mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:17:55 +00:00
Improve the error message produced by ThrowingAstVisitor
Change-Id: I4f4d725d52a244d9c37bc44802782f7d8e97ab9a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275400 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
4882c0f7b3
commit
1aebb81274
|
@ -2791,7 +2791,11 @@ class ThrowingAstVisitor<R> implements AstVisitor<R> {
|
|||
R? visitYieldStatement(YieldStatement node) => _throw(node);
|
||||
|
||||
Never _throw(AstNode node) {
|
||||
throw Exception('Missing implementation of visit${node.runtimeType}');
|
||||
var typeName = node.runtimeType.toString();
|
||||
if (typeName.endsWith('Impl')) {
|
||||
typeName = typeName.substring(0, typeName.length - 4);
|
||||
}
|
||||
throw Exception('Missing implementation of visit$typeName');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue