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

Unified Diff: pkg/compiler/lib/src/elements/resolution_types.dart

Issue 2699073003: Support `void` as generic argument.
Patch Set: Add specialized messages for `void` for-ins. Created 3 years, 9 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/compiler/lib/src/elements/resolution_types.dart
diff --git a/pkg/compiler/lib/src/elements/resolution_types.dart b/pkg/compiler/lib/src/elements/resolution_types.dart
index 0f4b7bf10382f6be1c6ac6f5e8d5fef3efe3993d..24a3f0f410c94cdb0572b5f5c57812ce15987d7b 100644
--- a/pkg/compiler/lib/src/elements/resolution_types.dart
+++ b/pkg/compiler/lib/src/elements/resolution_types.dart
@@ -1231,12 +1231,13 @@ class MoreSpecificVisitor extends AbstractTypeRelation {
MoreSpecificVisitor(Resolution resolution) : super(resolution);
bool isMoreSpecific(ResolutionDartType t, ResolutionDartType s) {
+ // Treat void as Object.
+ if (t.isVoid) t = commonElements.objectType as DartType;
+ if (s.isVoid) s = commonElements.objectType as DartType;
+
if (identical(t, s) || s.treatAsDynamic || t == commonElements.nullType) {
return true;
}
- if (t.isVoid || s.isVoid) {
- return false;
- }
if (t.treatAsDynamic) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698