| 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.non_error_resolver_test; | 5 library analyzer.test.generated.non_error_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
| (...skipping 3907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3918 void test_nonConstantDefaultValue_inConstructor_positional() { | 3918 void test_nonConstantDefaultValue_inConstructor_positional() { |
| 3919 Source source = addSource(r''' | 3919 Source source = addSource(r''' |
| 3920 class A { | 3920 class A { |
| 3921 A([x = 2 + 3]) {} | 3921 A([x = 2 + 3]) {} |
| 3922 }'''); | 3922 }'''); |
| 3923 computeLibrarySourceErrors(source); | 3923 computeLibrarySourceErrors(source); |
| 3924 assertNoErrors(source); | 3924 assertNoErrors(source); |
| 3925 verify([source]); | 3925 verify([source]); |
| 3926 } | 3926 } |
| 3927 | 3927 |
| 3928 void test_nonConstantDefaultValue_is_constField() { |
| 3929 Source source = addSource(r''' |
| 3930 f([a = double.INFINITY]) { |
| 3931 }'''); |
| 3932 computeLibrarySourceErrors(source); |
| 3933 assertNoErrors(source); |
| 3934 verify([source]); |
| 3935 } |
| 3936 |
| 3937 void test_nonConstantDefaultValue_is_constTypeList() { |
| 3938 Source source = addSource(r''' |
| 3939 class A { |
| 3940 m([p111 = const <String>[]]) {} |
| 3941 } |
| 3942 class B extends A { |
| 3943 m([p222 = const <String>[]]) {} |
| 3944 }'''); |
| 3945 computeLibrarySourceErrors(source); |
| 3946 assertNoErrors(source); |
| 3947 verify([source]); |
| 3948 } |
| 3949 |
| 3928 void test_nonConstantDefaultValue_method_named() { | 3950 void test_nonConstantDefaultValue_method_named() { |
| 3929 Source source = addSource(r''' | 3951 Source source = addSource(r''' |
| 3930 class A { | 3952 class A { |
| 3931 m({x : 2 + 3}) {} | 3953 m({x : 2 + 3}) {} |
| 3932 }'''); | 3954 }'''); |
| 3933 computeLibrarySourceErrors(source); | 3955 computeLibrarySourceErrors(source); |
| 3934 assertNoErrors(source); | 3956 assertNoErrors(source); |
| 3935 verify([source]); | 3957 verify([source]); |
| 3936 } | 3958 } |
| 3937 | 3959 |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5964 reset(); | 5986 reset(); |
| 5965 } | 5987 } |
| 5966 | 5988 |
| 5967 void _check_wrongNumberOfParametersForOperator1(String name) { | 5989 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 5968 _check_wrongNumberOfParametersForOperator(name, "a"); | 5990 _check_wrongNumberOfParametersForOperator(name, "a"); |
| 5969 } | 5991 } |
| 5970 | 5992 |
| 5971 CompilationUnit _getResolvedLibraryUnit(Source source) => | 5993 CompilationUnit _getResolvedLibraryUnit(Source source) => |
| 5972 analysisContext.getResolvedCompilationUnit2(source, source); | 5994 analysisContext.getResolvedCompilationUnit2(source, source); |
| 5973 } | 5995 } |
| OLD | NEW |