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: pkg/compiler/lib/src/warnings.dart

Issue 1078873003: Report compile-time error if using `this` implicitly in initializers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 static const MessageKind THIS_IS_THE_DECLARATION = const MessageKind( 149 static const MessageKind THIS_IS_THE_DECLARATION = const MessageKind(
150 "This is the declaration of '#{name}'."); 150 "This is the declaration of '#{name}'.");
151 151
152 static const MessageKind THIS_IS_THE_METHOD = const MessageKind( 152 static const MessageKind THIS_IS_THE_METHOD = const MessageKind(
153 "This is the method declaration."); 153 "This is the method declaration.");
154 154
155 static const MessageKind CANNOT_RESOLVE = const MessageKind( 155 static const MessageKind CANNOT_RESOLVE = const MessageKind(
156 "Cannot resolve '#{name}'."); 156 "Cannot resolve '#{name}'.");
157 157
158 static const MessageKind CANNOT_RESOLVE_IN_INITIALIZER = const MessageKind(
159 "Cannot resolve '#{name}'. It would be implicitly looked up on this "
160 "instance, but instances are not available in initializers.");
Johnni Winther 2015/04/12 11:10:45 If you add [howToFix] and [examples] we will autom
Siggi Cherem (dart-lang) 2015/04/13 16:40:24 Nice, Done.
161
158 static const MessageKind CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind( 162 static const MessageKind CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind(
159 "Cannot resolve constructor '#{constructorName}'."); 163 "Cannot resolve constructor '#{constructorName}'.");
160 164
161 static const MessageKind CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT = 165 static const MessageKind CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT =
162 const MessageKind("cannot resolve constructor '#{constructorName}'" 166 const MessageKind("cannot resolve constructor '#{constructorName}'"
163 " for implicit super call.", 167 " for implicit super call.",
164 howToFix: "Try explicitly invoking a constructor of the super class", 168 howToFix: "Try explicitly invoking a constructor of the super class",
165 examples: const [""" 169 examples: const ["""
166 class A { 170 class A {
167 A.foo() {} 171 A.foo() {}
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 static String convertToString(value) { 2491 static String convertToString(value) {
2488 if (value is ErrorToken) { 2492 if (value is ErrorToken) {
2489 // Shouldn't happen. 2493 // Shouldn't happen.
2490 return value.assertionMessage; 2494 return value.assertionMessage;
2491 } else if (value is Token) { 2495 } else if (value is Token) {
2492 value = value.value; 2496 value = value.value;
2493 } 2497 }
2494 return '$value'; 2498 return '$value';
2495 } 2499 }
2496 } 2500 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698