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

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

Issue 27190002: Emit compile-time error if a redirecting factory points to itself. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 369405f20afba3ca1607be1657893ed00069e5aa..6d9feceff977b68a71437cf21d267190c46b5bbf 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2729,6 +2729,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
!redirectionTarget.modifiers.isConst()) {
error(node, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
}
+ if (redirectionTarget == constructor) {
+ compiler.reportError(node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
+ return;
+ }
constructor.defaultImplementation = redirectionTarget;
if (Elements.isUnresolved(redirectionTarget)) {
compiler.backend.registerThrowNoSuchMethod(mapping);
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698