Index: pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart |
diff --git a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart |
index 796811370f0062a4597812705ac9013670f8c09c..dbba17103ecbab2aa55ccc7736710580ac6de378 100644 |
--- a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart |
+++ b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart |
@@ -10,6 +10,7 @@ import 'package:analyzer/dart/ast/visitor.dart' show RecursiveAstVisitor; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/dart/element/type.dart'; |
import 'element_helpers.dart' show getStaticType, isInlineJS; |
+import 'property_model.dart'; |
/// An inference engine for nullable types. |
/// |
@@ -23,6 +24,8 @@ import 'element_helpers.dart' show getStaticType, isInlineJS; |
// better non-nullability in the type system. |
abstract class NullableTypeInference { |
LibraryElement get dartCoreLibrary; |
+ VirtualFieldModel get virtualFields; |
+ |
bool isPrimitiveType(DartType type); |
bool isObjectMember(String name); |
@@ -81,7 +84,8 @@ abstract class NullableTypeInference { |
if (element is PropertyAccessorElement && element.isGetter) { |
PropertyInducingElement variable = element.variable; |
- var isVirtual = variable is FieldElement && variable.isVirtual; |
+ var isVirtual = |
+ variable is FieldElement && virtualFields.isVirtual(variable); |
return isVirtual || (variable.computeConstantValue()?.isNull ?? true); |
} |