| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
| 3 * | 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * | 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * | 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form | 717 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form |
| 718 * <i>return;</i> It is a static warning if both of the following conditions h
old: | 718 * <i>return;</i> It is a static warning if both of the following conditions h
old: |
| 719 * <ol> | 719 * <ol> |
| 720 * <li><i>f</i> is not a generative constructor. | 720 * <li><i>f</i> is not a generative constructor. |
| 721 * <li>The return type of <i>f</i> may not be assigned to void. | 721 * <li>The return type of <i>f</i> may not be assigned to void. |
| 722 * </ol> | 722 * </ol> |
| 723 */ | 723 */ |
| 724 RETURN_WITHOUT_VALUE("Missing return value after 'return'"), | 724 RETURN_WITHOUT_VALUE("Missing return value after 'return'"), |
| 725 | 725 |
| 726 /** | 726 /** |
| 727 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | 727 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method |
| 728 * or getter <i>m</i>. | 728 * or getter <i>m</i>. |
| 729 * | 729 * |
| 730 * @param memberName the name of the instance member | 730 * @param memberName the name of the instance member |
| 731 */ | 731 */ |
| 732 STATIC_ACCESS_TO_INSTANCE_MEMBER("Instance member '%s' cannot be accessed usin
g static access"), | 732 STATIC_ACCESS_TO_INSTANCE_MEMBER("Instance member '%s' cannot be accessed usin
g static access"), |
| 733 | 733 |
| 734 /** | 734 /** |
| 735 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of | 735 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of |
| 736 * <i>e<sub>k</sub></i>. | 736 * <i>e<sub>k</sub></i>. |
| 737 */ | 737 */ |
| 738 SWITCH_EXPRESSION_NOT_ASSIGNABLE( | 738 SWITCH_EXPRESSION_NOT_ASSIGNABLE( |
| 739 "Type '%s' of the switch expression is not assignable to the type '%s' of
case expressions"), | 739 "Type '%s' of the switch expression is not assignable to the type '%s' of
case expressions"), |
| 740 | 740 |
| 741 /** | 741 /** |
| 742 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the | 742 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the |
| 743 * current lexical scope. | 743 * current lexical scope. |
| 744 */ | 744 */ |
| 745 TYPE_TEST_NON_TYPE("The name '%s' is not a type and cannot be used in an 'is'
expression"), | 745 TYPE_TEST_NON_TYPE("The name '%s' is not a type and cannot be used in an 'is'
expression"), |
| 746 | 746 |
| 747 /** | 747 /** |
| 748 * 10 Generics: However, a type parameter is considered to be a malformed type
when referenced by | 748 * 10 Generics: However, a type parameter is considered to be a malformed type
when referenced by |
| 749 * a static member. | 749 * a static member. |
| 750 * <p> | 750 * <p> |
| 751 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni
ng. A malformed type | 751 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni
ng. A malformed type |
| 752 * is then interpreted as dynamic by the static type checker and the runtime. | 752 * is then interpreted as dynamic by the static type checker and the runtime. |
| 753 */ | 753 */ |
| 754 TYPE_PARAMETER_REFERENCED_BY_STATIC("Static members cannot reference type para
meters"), | 754 TYPE_PARAMETER_REFERENCED_BY_STATIC("Static members cannot reference type para
meters"), |
| 755 | 755 |
| 756 /** | 756 /** |
| 757 * 12.15.3 Static Invocation: A static method invocation <i>i</i> has the form | 757 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form |
| 758 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … | 758 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … |
| 759 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> d
oes not denote a | 759 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> d
oes not denote a |
| 760 * class in the current scope. | 760 * class in the current scope. |
| 761 * | 761 * |
| 762 * @param undefinedClassName the name of the undefined class | 762 * @param undefinedClassName the name of the undefined class |
| 763 */ | 763 */ |
| 764 UNDEFINED_CLASS("Undefined class '%s'"), | 764 UNDEFINED_CLASS("Undefined class '%s'"), |
| 765 | 765 |
| 766 /** | 766 /** |
| 767 * Same as {@link #UNDEFINED_CLASS}, but to catch using "boolean" instead of "
bool". | 767 * Same as {@link #UNDEFINED_CLASS}, but to catch using "boolean" instead of "
bool". |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter | 808 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter |
| 809 * <i>v=</i>. | 809 * <i>v=</i>. |
| 810 * | 810 * |
| 811 * @param setterName the name of the getter | 811 * @param setterName the name of the getter |
| 812 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for | 812 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for |
| 813 */ | 813 */ |
| 814 // TODO(jwren) tests needed for this error code | 814 // TODO(jwren) tests needed for this error code |
| 815 UNDEFINED_SETTER("There is no such setter '%s' in '%s'"), | 815 UNDEFINED_SETTER("There is no such setter '%s' in '%s'"), |
| 816 | 816 |
| 817 /** | 817 /** |
| 818 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | 818 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method |
| 819 * or getter <i>m</i>. | 819 * or getter <i>m</i>. |
| 820 * | 820 * |
| 821 * @param methodName the name of the method | 821 * @param methodName the name of the method |
| 822 * @param enclosingType the name of the enclosing type where the method is bei
ng looked for | 822 * @param enclosingType the name of the enclosing type where the method is bei
ng looked for |
| 823 */ | 823 */ |
| 824 // TODO(jwren) Even though we have a message here, this warning code is not be
ing generated. | 824 // Note: all cases of this method are covered by the StaticWarningCode.UNDEFIN
ED_METHOD/UNDEFINED_GETTER and UNDEFINED_SETTER codes |
| 825 UNDEFINED_STATIC_METHOD_OR_GETTER("There is no such static method '%s' in '%s'
"); | 825 UNDEFINED_STATIC_METHOD_OR_GETTER("There is no such static method, getter or s
etter '%s' in '%s'"); |
| 826 | 826 |
| 827 /** | 827 /** |
| 828 * The template used to create the message to be displayed for this error. | 828 * The template used to create the message to be displayed for this error. |
| 829 */ | 829 */ |
| 830 private final String message; | 830 private final String message; |
| 831 | 831 |
| 832 /** | 832 /** |
| 833 * The template used to create the correction to be displayed for this error,
or {@code null} if | 833 * The template used to create the correction to be displayed for this error,
or {@code null} if |
| 834 * there is no correction information for this error. | 834 * there is no correction information for this error. |
| 835 */ | 835 */ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 @Override | 868 @Override |
| 869 public String getMessage() { | 869 public String getMessage() { |
| 870 return message; | 870 return message; |
| 871 } | 871 } |
| 872 | 872 |
| 873 @Override | 873 @Override |
| 874 public ErrorType getType() { | 874 public ErrorType getType() { |
| 875 return ErrorType.STATIC_WARNING; | 875 return ErrorType.STATIC_WARNING; |
| 876 } | 876 } |
| 877 } | 877 } |
| OLD | NEW |