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

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

Issue 1407903011: Better error message when missing new or const (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
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 'package:analyzer/src/generated/ast.dart' show AstNode; 9 import 'package:analyzer/src/generated/ast.dart' show AstNode;
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 4195 matching lines...) Expand 10 before | Expand all | Expand 10 after
4206 * 4206 *
4207 * Parameters: 4207 * Parameters:
4208 * 0: the name of the method that is undefined 4208 * 0: the name of the method that is undefined
4209 * 1: the resolved type name that the method lookup is happening on 4209 * 1: the resolved type name that the method lookup is happening on
4210 */ 4210 */
4211 static const StaticTypeWarningCode UNDEFINED_METHOD = 4211 static const StaticTypeWarningCode UNDEFINED_METHOD =
4212 const StaticTypeWarningCode('UNDEFINED_METHOD', 4212 const StaticTypeWarningCode('UNDEFINED_METHOD',
4213 "The method '{0}' is not defined for the class '{1}'"); 4213 "The method '{0}' is not defined for the class '{1}'");
4214 4214
4215 /** 4215 /**
4216 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
4217 * It is a static type warning if <i>T</i> does not have an accessible
4218 * instance member named <i>m</i>.
4219 *
4220 * Parameters:
4221 * 0: the name of the method that is undefined
4222 * 1: the resolved type name that the method lookup is happening on
4223 */
4224 static const StaticTypeWarningCode UNDEFINED_METHOD_WITH_CONSTRUCTOR =
4225 const StaticTypeWarningCode(
4226 'UNDEFINED_METHOD_WITH_CONSTRUCTOR',
4227 "The method '{0}' is not defined for the class '{1}', but a constructo r with that name is defined",
4228 "Add 'new' or 'const' to invoke the constuctor, or change the method n ame.");
4229
4230 /**
4216 * 12.18 Assignment: Evaluation of an assignment of the form 4231 * 12.18 Assignment: Evaluation of an assignment of the form
4217 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is 4232 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
4218 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); 4233 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
4219 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>, 4234 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>,
4220 * <i>e<sub>2</sub></i>). 4235 * <i>e<sub>2</sub></i>).
4221 * 4236 *
4222 * 12.29 Assignable Expressions: An assignable expression of the form 4237 * 12.29 Assignable Expressions: An assignable expression of the form
4223 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method 4238 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method
4224 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument 4239 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument
4225 * <i>e<sub>2</sub></i>. 4240 * <i>e<sub>2</sub></i>.
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
5617 * Initialize a newly created error code to have the given [name]. 5632 * Initialize a newly created error code to have the given [name].
5618 */ 5633 */
5619 const TodoCode(String name) : super(name, "{0}"); 5634 const TodoCode(String name) : super(name, "{0}");
5620 5635
5621 @override 5636 @override
5622 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5637 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5623 5638
5624 @override 5639 @override
5625 ErrorType get type => ErrorType.TODO; 5640 ErrorType get type => ErrorType.TODO;
5626 } 5641 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/test/generated/static_type_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698