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

Unified Diff: pkg/analyzer/lib/src/generated/type_system.dart

Issue 2200263004: Disallow assigning null to non-nullable variables (Closed) Base URL: https://github.com/dart-lang/sdk@master
Patch Set: Remove obsolete comment Created 4 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/analyzer/lib/src/generated/type_system.dart
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 0138526a9d239316da15ec1329bcefa1075423c6..28baf9fa9fa41e6a1823e32aacf8097e855b4728 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -763,6 +763,16 @@ class StrongTypeSystemImpl extends TypeSystem {
return (t.isDynamic && !dynamicIsBottom) || t.isObject;
}
+ bool isNonNullableType(DartType type) {
+ return nonnullableTypes.contains(_getTypeFullyQualifiedName(type));
+ }
+
+ /// Given a type return its name prepended with the URI to its containing
+ /// library and separated by a comma.
+ String _getTypeFullyQualifiedName(DartType type) {
+ return "${type?.element?.library?.identifier},$type";
Jennifer Messerly 2016/08/03 18:06:56 .source.uri ?
stanm 2016/08/03 18:46:20 Done.
+ }
+
/**
* This currently just implements a simple least upper bound to
* handle some common cases. It also avoids some termination issues

Powered by Google App Engine
This is Rietveld 408576698