| OLD | NEW |
| 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 analyzer.test.generated.compile_time_error_code_test; | 5 library analyzer.test.generated.compile_time_error_code_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/error.dart'; | 7 import 'package:analyzer/src/generated/error.dart'; |
| 8 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 8 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| 9 import 'package:analyzer/src/generated/source_io.dart'; | 9 import 'package:analyzer/src/generated/source_io.dart'; |
| 10 | 10 |
| (...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1961 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, | 1961 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, |
| 1962 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT | 1962 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT |
| 1963 ]); | 1963 ]); |
| 1964 verify([source]); | 1964 verify([source]); |
| 1965 } | 1965 } |
| 1966 | 1966 |
| 1967 void test_extendsDisallowedClass_class_double() { | 1967 void test_extendsDisallowedClass_class_double() { |
| 1968 Source source = addSource("class A extends double {}"); | 1968 Source source = addSource("class A extends double {}"); |
| 1969 computeLibrarySourceErrors(source); | 1969 computeLibrarySourceErrors(source); |
| 1970 assertErrors(source, [ | 1970 assertErrors(source, [ |
| 1971 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, | 1971 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS |
| 1972 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT | |
| 1973 ]); | 1972 ]); |
| 1974 verify([source]); | 1973 verify([source]); |
| 1975 } | 1974 } |
| 1976 | 1975 |
| 1977 void test_extendsDisallowedClass_class_int() { | 1976 void test_extendsDisallowedClass_class_int() { |
| 1978 Source source = addSource("class A extends int {}"); | 1977 Source source = addSource("class A extends int {}"); |
| 1979 computeLibrarySourceErrors(source); | 1978 computeLibrarySourceErrors(source); |
| 1980 assertErrors(source, [ | 1979 assertErrors(source, [ |
| 1981 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, | 1980 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, |
| 1982 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT | 1981 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT |
| 1983 ]); | 1982 ]); |
| 1984 verify([source]); | 1983 verify([source]); |
| 1985 } | 1984 } |
| 1986 | 1985 |
| 1987 void test_extendsDisallowedClass_class_Null() { | 1986 void test_extendsDisallowedClass_class_Null() { |
| 1988 Source source = addSource("class A extends Null {}"); | 1987 Source source = addSource("class A extends Null {}"); |
| 1989 computeLibrarySourceErrors(source); | 1988 computeLibrarySourceErrors(source); |
| 1990 assertErrors(source, [ | 1989 assertErrors(source, [ |
| 1991 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, | 1990 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, |
| 1992 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT | 1991 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT |
| 1993 ]); | 1992 ]); |
| 1994 verify([source]); | 1993 verify([source]); |
| 1995 } | 1994 } |
| 1996 | 1995 |
| 1997 void test_extendsDisallowedClass_class_num() { | 1996 void test_extendsDisallowedClass_class_num() { |
| 1998 Source source = addSource("class A extends num {}"); | 1997 Source source = addSource("class A extends num {}"); |
| 1999 computeLibrarySourceErrors(source); | 1998 computeLibrarySourceErrors(source); |
| 2000 assertErrors(source, [ | 1999 assertErrors(source, [ |
| 2001 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, | 2000 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS |
| 2002 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT | |
| 2003 ]); | 2001 ]); |
| 2004 verify([source]); | 2002 verify([source]); |
| 2005 } | 2003 } |
| 2006 | 2004 |
| 2007 void test_extendsDisallowedClass_class_String() { | 2005 void test_extendsDisallowedClass_class_String() { |
| 2008 Source source = addSource("class A extends String {}"); | 2006 Source source = addSource("class A extends String {}"); |
| 2009 computeLibrarySourceErrors(source); | 2007 computeLibrarySourceErrors(source); |
| 2010 assertErrors(source, [ | 2008 assertErrors(source, [ |
| 2011 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, | 2009 CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, |
| 2012 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT | 2010 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT |
| (...skipping 4252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6265 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6263 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
| 6266 verify([source]); | 6264 verify([source]); |
| 6267 reset(); | 6265 reset(); |
| 6268 } | 6266 } |
| 6269 | 6267 |
| 6270 void _check_wrongNumberOfParametersForOperator1(String name) { | 6268 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 6271 _check_wrongNumberOfParametersForOperator(name, ""); | 6269 _check_wrongNumberOfParametersForOperator(name, ""); |
| 6272 _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6270 _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 6273 } | 6271 } |
| 6274 } | 6272 } |
| OLD | NEW |