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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 25509003: It is statically OK to call methods on bottom type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
index 35c58fe5a3335ab06427e341f39810b72292f4e3..9f68a8b2a405fd96b25a9cee1e06f6238e797527 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
@@ -128,7 +128,6 @@ import com.google.dart.engine.internal.resolver.InheritanceManager;
import com.google.dart.engine.internal.resolver.TypeProvider;
import com.google.dart.engine.internal.scope.Namespace;
import com.google.dart.engine.internal.scope.NamespaceBuilder;
-import com.google.dart.engine.internal.type.BottomTypeImpl;
import com.google.dart.engine.internal.type.DynamicTypeImpl;
import com.google.dart.engine.internal.type.VoidTypeImpl;
import com.google.dart.engine.parser.ParserErrorCode;
@@ -4368,8 +4367,7 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
private boolean checkForReturnOfInvalidType(Expression returnExpression, Type expectedReturnType) {
Type staticReturnType = getStaticType(returnExpression);
if (expectedReturnType.isVoid()) {
- if (staticReturnType.isVoid() || staticReturnType.isDynamic()
- || staticReturnType == BottomTypeImpl.getInstance()) {
+ if (staticReturnType.isVoid() || staticReturnType.isDynamic() || staticReturnType.isBottom()) {
return false;
}
errorReporter.reportError(
@@ -4989,7 +4987,7 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
}
private boolean isFunctionType(Type type) {
- if (type.isDynamic() || type == BottomTypeImpl.getInstance()) {
+ if (type.isDynamic() || type.isBottom()) {
return true;
} else if (type instanceof FunctionType || type.isDartCoreFunction()) {
return true;

Powered by Google App Engine
This is Rietveld 408576698