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

Side by Side Diff: frog/leg/warnings.dart

Issue 9391004: Implement cycle-checking and code generation for redirecting constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and add a test. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class MessageKind { 5 class MessageKind {
6 final String template; 6 final String template;
7 const MessageKind(this.template); 7 const MessageKind(this.template);
8 8
9 static final GENERIC = const MessageKind('#{1}'); 9 static final GENERIC = const MessageKind('#{1}');
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 static final ALREADY_INITIALIZED = const MessageKind( 61 static final ALREADY_INITIALIZED = const MessageKind(
62 '#{1} was already initialized here'); 62 '#{1} was already initialized here');
63 static final INIT_STATIC_FIELD = const MessageKind( 63 static final INIT_STATIC_FIELD = const MessageKind(
64 'cannot initialize static field #{1}'); 64 'cannot initialize static field #{1}');
65 static final NOT_A_FIELD = const MessageKind( 65 static final NOT_A_FIELD = const MessageKind(
66 '#{1} is not a field'); 66 '#{1} is not a field');
67 static final CONSTRUCTOR_CALL_EXPECTED = const MessageKind( 67 static final CONSTRUCTOR_CALL_EXPECTED = const MessageKind(
68 "only call to 'this' or 'super' constructor allowed"); 68 "only call to 'this' or 'super' constructor allowed");
69 static final INVALID_FOR_IN = const MessageKind( 69 static final INVALID_FOR_IN = const MessageKind(
70 'Invalid for-in variable declaration.'); 70 'Invalid for-in variable declaration.');
71 static final REDIRECTING_CTOR_HAS_INITIALIZER = const MessageKind( 71 static final REDIRECTING_CONSTRUCTOR_CYCLE = const MessageKind(
72 'cyclic constructor redirection');
73 static final REDIRECTING_CONSTRUCTOR_HAS_BODY = const MessageKind(
74 'redirecting constructor cannot have a body');
75 static final REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER = const MessageKind(
72 'redirecting constructor cannot have other initializers'); 76 'redirecting constructor cannot have other initializers');
73 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind( 77 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind(
74 "'Object' cannot have a super initializer"); 78 "'Object' cannot have a super initializer");
75 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind( 79 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind(
76 'cannot have more than one super initializer'); 80 'cannot have more than one super initializer');
77 static final NO_MATCHING_CONSTRUCTOR = const MessageKind( 81 static final NO_MATCHING_CONSTRUCTOR = const MessageKind(
78 'no matching constructor found'); 82 'no matching constructor found');
79 static final NO_CONSTRUCTOR = const MessageKind( 83 static final NO_CONSTRUCTOR = const MessageKind(
80 '#{1} is a #{2}, not a constructor'); 84 '#{1} is a #{2}, not a constructor');
81 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind( 85 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 String toString() => message.toString(); 152 String toString() => message.toString();
149 } 153 }
150 154
151 class CompileTimeConstantError { 155 class CompileTimeConstantError {
152 final Message message; 156 final Message message;
153 CompileTimeConstantError.message(this.message); 157 CompileTimeConstantError.message(this.message);
154 CompileTimeConstantError(MessageKind kind, List<Type> arguments) 158 CompileTimeConstantError(MessageKind kind, List<Type> arguments)
155 : message = new Message(kind, arguments); 159 : message = new Message(kind, arguments);
156 String toString() => message.toString(); 160 String toString() => message.toString();
157 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698