mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:07:11 +00:00
[ddc] Fix cast when retrieving annotation name
Name can be null and cast failures start appearing here when running with sound null safety. Issue: https://github.com/dart-lang/sdk/issues/46617 Change-Id: I3d96e80283889915cc28a310a1db940a9c6bcab1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250409 Reviewed-by: Mark Zhou <markzipan@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
bc458d5341
commit
f3daca2ef6
1 changed files with 1 additions and 1 deletions
|
@ -6534,7 +6534,7 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
|
|||
String? _annotationName(NamedNode node, bool Function(Expression) test) {
|
||||
var annotation = findAnnotation(node, test);
|
||||
return annotation != null
|
||||
? _constants.getFieldValueFromAnnotation(annotation, 'name') as String
|
||||
? _constants.getFieldValueFromAnnotation(annotation, 'name') as String?
|
||||
: null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue