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

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

Issue 9283014: Implement field parameter for generative constructors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static final REDIRECTING_CTOR_HAS_INITIALIZER = const MessageKind( 69 static final REDIRECTING_CTOR_HAS_INITIALIZER = const MessageKind(
70 'redirecting constructor cannot have other initializers'); 70 'redirecting constructor cannot have other initializers');
71 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind( 71 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind(
72 "'Object' cannot have a super initializer"); 72 "'Object' cannot have a super initializer");
73 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind( 73 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind(
74 'cannot have more than one super initializer'); 74 'cannot have more than one super initializer');
75 static final NO_MATCHING_CONSTRUCTOR = const MessageKind( 75 static final NO_MATCHING_CONSTRUCTOR = const MessageKind(
76 'no matching constructor found'); 76 'no matching constructor found');
77 static final NO_CONSTRUCTOR = const MessageKind( 77 static final NO_CONSTRUCTOR = const MessageKind(
78 '#{1} is a #{2}, not a constructor'); 78 '#{1} is a #{2}, not a constructor');
79 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind(
80 'A field parameter is only allowed in generative constructors');
81 static final INVALID_FIELD_PARAMETER = const MessageKind(
82 "A field parameter must be preceded by 'this'");
ahe 2012/01/24 14:28:44 This error message may be confusing. Just because
ngeoffray 2012/01/24 14:57:04 Done.
83 static final NOT_INSTANCE_FIELD = const MessageKind(
84 '#{1} is not an instance field');
79 85
80 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( 86 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind(
81 '#{1} cannot be used as compile-time constant.'); 87 '#{1} cannot be used as compile-time constant');
82 88
83 toString() => template; 89 toString() => template;
84 } 90 }
85 91
86 class Message { 92 class Message {
87 final kind; 93 final kind;
88 final List arguments; 94 final List arguments;
89 String message; 95 String message;
90 96
91 Message(this.kind, this.arguments); 97 Message(this.kind, this.arguments);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 String toString() => message.toString(); 137 String toString() => message.toString();
132 } 138 }
133 139
134 class CompileTimeConstantError { 140 class CompileTimeConstantError {
135 final Message message; 141 final Message message;
136 CompileTimeConstantError.message(this.message); 142 CompileTimeConstantError.message(this.message);
137 CompileTimeConstantError(MessageKind kind, List<Type> arguments) 143 CompileTimeConstantError(MessageKind kind, List<Type> arguments)
138 : message = new Message(kind, arguments); 144 : message = new Message(kind, arguments);
139 String toString() => message.toString(); 145 String toString() => message.toString();
140 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698