Index: lib/src/compiler/nullable_type_inference.dart |
diff --git a/lib/src/compiler/nullable_type_inference.dart b/lib/src/compiler/nullable_type_inference.dart |
index 0cbfd4ccd728cd30ee3841a696b6c834a9617331..706d677eacab6bb697116d0505632408544eb2fb 100644 |
--- a/lib/src/compiler/nullable_type_inference.dart |
+++ b/lib/src/compiler/nullable_type_inference.dart |
@@ -78,6 +78,11 @@ abstract class NullableTypeInference { |
return false; |
} |
+ if (element is PropertyAccessorElement && element.isGetter) { |
+ PropertyInducingElement variable = element.variable; |
+ return variable.constantValue?.isNull ?? true; |
+ } |
+ |
// Other types of identifiers are nullable (parameters, fields). |
return true; |
} |