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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 24073002: Emit error on default values in typedefs. (Closed) Base URL: https://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 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 = ""; 7 const DONT_KNOW_HOW_TO_FIX = "";
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 static const DualKind NO_SUCH_LIBRARY_MEMBER = const DualKind( 412 static const DualKind NO_SUCH_LIBRARY_MEMBER = const DualKind(
413 error: const MessageKind( 413 error: const MessageKind(
414 'Error: "#{libraryName}" has no member named "#{memberName}".'), 414 'Error: "#{libraryName}" has no member named "#{memberName}".'),
415 warning: const MessageKind( 415 warning: const MessageKind(
416 'Warning: "#{libraryName}" has no member named "#{memberName}".')); 416 'Warning: "#{libraryName}" has no member named "#{memberName}".'));
417 417
418 static const MessageKind CANNOT_INSTANTIATE_TYPEDEF = const MessageKind( 418 static const MessageKind CANNOT_INSTANTIATE_TYPEDEF = const MessageKind(
419 'Error: Cannot instantiate typedef "#{typedefName}".'); 419 'Error: Cannot instantiate typedef "#{typedefName}".');
420 420
421 static const MessageKind TYPEDEF_FORMAL_WITH_DEFAULT = const MessageKind(
422 "Error: A parameter of a typedef can't specify a default value.",
423 howToFix: "Remove the default value.",
424 examples: const ["""
425 typedef void F([int arg: 0]);
Johnni Winther 2013/09/09 13:23:18 Wrong syntax: It should [int arg = 0] or {int arg:
karlklose 2013/09/09 13:38:56 Done.
426
427 main() {
428 F f;
429 }"""]);
430
421 static const MessageKind CANNOT_INSTANTIATE_TYPE_VARIABLE = const MessageKind( 431 static const MessageKind CANNOT_INSTANTIATE_TYPE_VARIABLE = const MessageKind(
422 'Error: Cannot instantiate type variable "#{typeVariableName}".'); 432 'Error: Cannot instantiate type variable "#{typeVariableName}".');
423 433
424 static const MessageKind CYCLIC_TYPE_VARIABLE = const MessageKind( 434 static const MessageKind CYCLIC_TYPE_VARIABLE = const MessageKind(
425 'Warning: Type variable "#{typeVariableName}" is a supertype of itself.'); 435 'Warning: Type variable "#{typeVariableName}" is a supertype of itself.');
426 436
427 static const MessageKind CLASS_NAME_EXPECTED = const MessageKind( 437 static const MessageKind CLASS_NAME_EXPECTED = const MessageKind(
428 'Error: Class name expected.'); 438 'Error: Class name expected.');
429 439
430 static const MessageKind CANNOT_EXTEND = const MessageKind( 440 static const MessageKind CANNOT_EXTEND = const MessageKind(
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 1080
1071 class CompileTimeConstantError extends Diagnostic { 1081 class CompileTimeConstantError extends Diagnostic {
1072 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) 1082 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse)
1073 : super(kind, arguments, terse); 1083 : super(kind, arguments, terse);
1074 } 1084 }
1075 1085
1076 class CompilationError extends Diagnostic { 1086 class CompilationError extends Diagnostic {
1077 CompilationError(MessageKind kind, Map arguments, bool terse) 1087 CompilationError(MessageKind kind, Map arguments, bool terse)
1078 : super(kind, arguments, terse); 1088 : super(kind, arguments, terse);
1079 } 1089 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698