Skip to content

Commit fb85d41

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Catch another exception earlier in the code
Change-Id: Ia9fdca760c4c0838cdb6bb31c00f296fbf21cbac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106102 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Paul Berry <paulberry@google.com> Auto-Submit: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Paul Berry <paulberry@google.com>
1 parent e3004da commit fb85d41

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/nnbd_migration/lib/src/graph_builder.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,10 @@ $stackTrace''');
530530
if (typeArguments == null) {
531531
var instantiatedType =
532532
_variables.decoratedTypeAnnotation(_source, typeName);
533+
if (instantiatedType == null) {
534+
throw new StateError('No type annotation for type name '
535+
'${typeName.toSource()}, offset=${typeName.offset}');
536+
}
533537
for (int i = 0; i < instantiatedType.typeArguments.length; i++) {
534538
_unionDecoratedTypes(
535539
instantiatedType.typeArguments[i],

0 commit comments

Comments
 (0)