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

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

Issue 2699073003: Support `void` as generic argument.
Patch Set: Shuffle things around to have a better `voidRti` locality. Created 3 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/elements/resolution_types.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/types.dart
diff --git a/pkg/compiler/lib/src/elements/types.dart b/pkg/compiler/lib/src/elements/types.dart
index ba4b8d1731d55adb4700d6902ed4a6512bb19d62..e8c5c6e6b44bfba304ea9ef56f56984681661c90 100644
--- a/pkg/compiler/lib/src/elements/types.dart
+++ b/pkg/compiler/lib/src/elements/types.dart
@@ -646,12 +646,13 @@ abstract class AbstractTypeRelation
abstract class MoreSpecificVisitor extends AbstractTypeRelation {
bool isMoreSpecific(DartType t, DartType s) {
+ // Treat void as Object.
+ if (t.isVoid) t = commonElements.objectType;
+ if (s.isVoid) s = commonElements.objectType;
+
if (identical(t, s) || s.treatAsDynamic || t == commonElements.nullType) {
return true;
}
- if (t.isVoid || s.isVoid) {
- return false;
- }
if (t.treatAsDynamic) {
return false;
}
« no previous file with comments | « pkg/compiler/lib/src/elements/resolution_types.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698