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

Unified Diff: lib/runtime/dart_runtime.dart

Issue 962213003: fix analysis messages (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | lib/src/testing.dart » ('j') | test/checker/inferred_type_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_runtime.dart
diff --git a/lib/runtime/dart_runtime.dart b/lib/runtime/dart_runtime.dart
index 7b6ec4f83cd72dbb3c2f4354075f407af8ae9ad3..742e77ce43db61ce1cf9a0f0ebb1bc4d95013bfa 100644
--- a/lib/runtime/dart_runtime.dart
+++ b/lib/runtime/dart_runtime.dart
@@ -128,21 +128,7 @@ Arity getArity(Function f) {
return new Arity._internal(normal, optionalPositional);
}
-bool _isFunctionSubType(TypeMirror t1, TypeMirror t2) {
- // Function types follow the standard non-Dart rule:
- // - contravariant on param types
- // - covariant on return type
- final f1 = t1 as FunctionTypeMirror;
- final f2 = t2 as FunctionTypeMirror;
-
- final params1 = f1.parameters;
- final params2 = f2.parameters;
- final ret1 = f1.returnType;
- final ret2 = f2.returnType;
- return _isFunctionSubTypeHelper(ret1, params1, ret2, params2);
-}
-
-bool _isFunctionSubTypeHelper(TypeMirror ret1, List<ParameterMirror> params1,
+bool _isFunctionSubType(TypeMirror ret1, List<ParameterMirror> params1,
TypeMirror ret2, List<ParameterMirror> params2) {
if (!_isSubType(ret1, ret2)) {
// Covariant return types
@@ -334,5 +320,5 @@ bool _isSubType(TypeMirror t1, TypeMirror t2) {
if (_reflects(c2, Function)) return true;
// Check structural function subtyping
- return _isFunctionSubTypeHelper(ret1, params1, c2.returnType, c2.parameters);
+ return _isFunctionSubType(ret1, params1, c2.returnType, c2.parameters);
}
« no previous file with comments | « no previous file | lib/src/testing.dart » ('j') | test/checker/inferred_type_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698