| Index: pkg/analyzer/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
|
| index 3e1dc6bfb3ff04166ad35619c0e6ca7e38eda4ec..8013c4c08be7a9ef3b632ca9e6788c518eaf70da 100644
|
| --- a/pkg/analyzer/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart
|
| @@ -7584,9 +7584,10 @@ class ResolverVisitor extends ScopedVisitor {
|
| potentialType ??= DynamicTypeImpl.instance;
|
|
|
| // Check if we can promote to potentialType from type.
|
| - if (typeSystem.canPromoteToType(potentialType, type)) {
|
| + DartType promoteType = typeSystem.tryPromoteToType(potentialType, type);
|
| + if (promoteType != null) {
|
| // Do promote type of variable.
|
| - _promoteManager.setType(element, potentialType);
|
| + _promoteManager.setType(element, promoteType);
|
| }
|
| }
|
| }
|
|
|