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

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 707073002: Fix analyzer's treatment of mixin constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor clean-ups Created 6 years, 1 month 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library engine.error; 5 library engine.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'java_core.dart'; 8 import 'java_core.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 import 'scanner.dart' show Token; 10 import 'scanner.dart' show Token;
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 * 9.1 Mixin Application: It is a compile-time error if the with clause of a 1415 * 9.1 Mixin Application: It is a compile-time error if the with clause of a
1416 * mixin application <i>C</i> includes a deferred type expression. 1416 * mixin application <i>C</i> includes a deferred type expression.
1417 * 1417 *
1418 * @param typeName the name of the type that cannot be extended 1418 * @param typeName the name of the type that cannot be extended
1419 * @see #EXTENDS_DEFERRED_CLASS 1419 * @see #EXTENDS_DEFERRED_CLASS
1420 * @see #IMPLEMENTS_DEFERRED_CLASS 1420 * @see #IMPLEMENTS_DEFERRED_CLASS
1421 */ 1421 */
1422 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'" ); 1422 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'" );
1423 1423
1424 /** 1424 /**
1425 * Not yet in the spec, but consistent with VM behavior. It is a
1426 * compile-time error if all of the constructors of a mixin's base class have
1427 * at least one optional parameter (since only constructors that lack
1428 * optional parameters can be forwarded to the mixin). See
1429 * https://code.google.com/p/dart/issues/detail?id=15101#c4
1430 */
1431 static const CompileTimeErrorCode MIXIN_HAS_NO_CONSTRUCTORS =
1432 const CompileTimeErrorCode('MIXIN_HAS_NO_CONSTRUCTORS',
1433 "No constructors could be created for this class, since all the "
1434 "constructors in the base class have at least one optional "
1435 "parameter.");
Brian Wilkerson 2014/11/07 16:59:32 I find this message to be confusing and think that
Paul Berry 2014/11/07 17:31:01 Good point. I've changed it to "This mixin applic
1436
1437 /**
1425 * 9 Mixins: It is a compile-time error if a mixin is derived from a class 1438 * 9 Mixins: It is a compile-time error if a mixin is derived from a class
1426 * whose superclass is not Object. 1439 * whose superclass is not Object.
1427 * 1440 *
1428 * @param typeName the name of the mixin that is invalid 1441 * @param typeName the name of the mixin that is invalid
1429 */ 1442 */
1430 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be use d as a mixin because it extends a class other than Object"); 1443 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be use d as a mixin because it extends a class other than Object");
1431 1444
1432 /** 1445 /**
1433 * 12.2 Null: It is a compile-time error for a class to attempt to extend or 1446 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
1434 * implement Null. 1447 * implement Null.
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
4024 * Initialize a newly created error code to have the given [name]. 4037 * Initialize a newly created error code to have the given [name].
4025 */ 4038 */
4026 const TodoCode(String name) : super(name, "{0}"); 4039 const TodoCode(String name) : super(name, "{0}");
4027 4040
4028 @override 4041 @override
4029 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 4042 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
4030 4043
4031 @override 4044 @override
4032 ErrorType get type => ErrorType.TODO; 4045 ErrorType get type => ErrorType.TODO;
4033 } 4046 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698