Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart

Issue 3007533002: Address additional comments on nullability (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 51469d8b88a213ee0c8be154dfb88159393d1357..e9e2bab44ff6ab8724b51a06e2b0d0a86af202f6 100644
--- a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
+++ b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
@@ -108,20 +108,17 @@ abstract class NullableTypeInference {
// type.
Element container = element.enclosingElement;
if (container is ClassElement) {
- DartType targetType = container.type;
- InterfaceType implType = getImplementationType(targetType);
+ var targetType = container.type;
+ var implType = getImplementationType(targetType);
if (implType != null) {
- PropertyAccessorElement getter =
- implType.lookUpGetter(name, dartCoreLibrary);
+ var getter = implType.lookUpGetter(name, dartCoreLibrary);
if (getter != null) element = getter;
}
}
// If the getter is a synthetic element, then any annotations will
// be on the variable, so use those instead.
- if (element is PropertyAccessorElement &&
- element.isSynthetic &&
- element.variable != null) {
- element = (element as PropertyAccessorElement).variable;
+ if (element is PropertyAccessorElement && element.isSynthetic) {
+ return _assertedNotNull(element.variable);
}
// Return true if the element is annotated as returning a non-null value.
return _assertedNotNull(element);
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/element_helpers.dart ('k') | pkg/dev_compiler/lib/src/compiler/reify_coercions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698