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

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

Issue 895113002: Add static type checking of "yield" statements to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 import 'ast.dart' show AstNode; 9 import 'ast.dart' show AstNode;
10 import 'element.dart'; 10 import 'element.dart';
(...skipping 3698 matching lines...) Expand 10 before | Expand all | Expand 10 after
3709 * @param argumentCount the number of type arguments provided 3709 * @param argumentCount the number of type arguments provided
3710 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and 3710 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
3711 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]. 3711 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS].
3712 */ 3712 */
3713 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = 3713 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS =
3714 const StaticTypeWarningCode( 3714 const StaticTypeWarningCode(
3715 'WRONG_NUMBER_OF_TYPE_ARGUMENTS', 3715 'WRONG_NUMBER_OF_TYPE_ARGUMENTS',
3716 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given"); 3716 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given");
3717 3717
3718 /** 3718 /**
3719 * 17.16.1 Yield: Let T be the static type of e [the expression to the right
3720 * of "yield"] and let f be the immediately enclosing function. It is a
3721 * static type warning if either:
3722 *
3723 * - the body of f is marked async* and the type Stream<T> may not be
3724 * assigned to the declared return type of f.
3725 *
3726 * - the body of f is marked sync* and the type Iterable<T> may not be
3727 * assigned to the declared return type of f.
3728 */
3729 static const StaticTypeWarningCode YIELD_OF_INVALID_TYPE =
3730 const StaticTypeWarningCode(
3731 'YIELD_OF_INVALID_TYPE',
3732 "The declared return type '{0}' is incompatible with the type '{1}' im plied by the 'yield' expression");
3733
3734 /**
3719 * Initialize a newly created error code to have the given [name]. The message 3735 * Initialize a newly created error code to have the given [name]. The message
3720 * associated with the error will be created from the given [message] 3736 * associated with the error will be created from the given [message]
3721 * template. The correction associated with the error will be created from the 3737 * template. The correction associated with the error will be created from the
3722 * given [correction] template. 3738 * given [correction] template.
3723 */ 3739 */
3724 const StaticTypeWarningCode(String name, String message, [String correction]) 3740 const StaticTypeWarningCode(String name, String message, [String correction])
3725 : super(name, message, correction); 3741 : super(name, message, correction);
3726 3742
3727 @override 3743 @override
3728 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; 3744 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
4978 * Initialize a newly created error code to have the given [name]. 4994 * Initialize a newly created error code to have the given [name].
4979 */ 4995 */
4980 const TodoCode(String name) : super(name, "{0}"); 4996 const TodoCode(String name) : super(name, "{0}");
4981 4997
4982 @override 4998 @override
4983 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 4999 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
4984 5000
4985 @override 5001 @override
4986 ErrorType get type => ErrorType.TODO; 5002 ErrorType get type => ErrorType.TODO;
4987 } 5003 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698