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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 24153008: Check if signatures are compatible in a redirecting factory before synthesizing a call in the infer… (Closed) Base URL: http://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: sdk/lib/_internal/compiler/implementation/resolution/members.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/resolution/members.dart (revision 27593)
+++ sdk/lib/_internal/compiler/implementation/resolution/members.dart (working copy)
@@ -2653,7 +2653,8 @@
FunctionType targetType = redirectionTarget.computeType(compiler)
.subst(type.typeArguments, targetClass.typeVariables);
FunctionType constructorType = constructor.computeType(compiler);
- if (!compiler.types.isSubtype(targetType, constructorType)) {
+ bool isSubtype = compiler.types.isSubtype(targetType, constructorType);
+ if (!isSubtype) {
warning(node, MessageKind.NOT_ASSIGNABLE.warning,
{'fromType': targetType, 'toType': constructorType});
}
@@ -2663,6 +2664,7 @@
FunctionSignature constructorSignature =
constructor.computeSignature(compiler);
if (!targetSignature.isCompatibleWith(constructorSignature)) {
+ assert(!isSubtype);
compiler.backend.registerThrowNoSuchMethod(mapping);
}

Powered by Google App Engine
This is Rietveld 408576698