| 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 engine.non_error_resolver_test; | 5 library engine.non_error_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| (...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3751 void test_optionalParameterInOperator_required() { | 3751 void test_optionalParameterInOperator_required() { |
| 3752 Source source = addSource(r''' | 3752 Source source = addSource(r''' |
| 3753 class A { | 3753 class A { |
| 3754 operator +(p) {} | 3754 operator +(p) {} |
| 3755 }'''); | 3755 }'''); |
| 3756 resolve(source); | 3756 resolve(source); |
| 3757 assertNoErrors(source); | 3757 assertNoErrors(source); |
| 3758 verify([source]); | 3758 verify([source]); |
| 3759 } | 3759 } |
| 3760 | 3760 |
| 3761 void test_parameterDefaultDoesNotReferToParameterName() { |
| 3762 // The final "f" should refer to the toplevel function "f", not to the |
| 3763 // parameter called "f". See dartbug.com/13179. |
| 3764 Source source = addSource('void f([void f([x]) = f]) {}'); |
| 3765 resolve(source); |
| 3766 assertNoErrors(source); |
| 3767 verify([source]); |
| 3768 } |
| 3769 |
| 3761 void test_parameterScope_local() { | 3770 void test_parameterScope_local() { |
| 3762 // Parameter names shouldn't conflict with the name of the function they | 3771 // Parameter names shouldn't conflict with the name of the function they |
| 3763 // are enclosed in. | 3772 // are enclosed in. |
| 3764 Source source = addSource(r''' | 3773 Source source = addSource(r''' |
| 3765 f() { | 3774 f() { |
| 3766 g(g) { | 3775 g(g) { |
| 3767 h(g); | 3776 h(g); |
| 3768 } | 3777 } |
| 3769 } | 3778 } |
| 3770 h(x) {} | 3779 h(x) {} |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5362 resolve(source); | 5371 resolve(source); |
| 5363 assertNoErrors(source); | 5372 assertNoErrors(source); |
| 5364 verify([source]); | 5373 verify([source]); |
| 5365 reset(); | 5374 reset(); |
| 5366 } | 5375 } |
| 5367 | 5376 |
| 5368 void _check_wrongNumberOfParametersForOperator1(String name) { | 5377 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 5369 _check_wrongNumberOfParametersForOperator(name, "a"); | 5378 _check_wrongNumberOfParametersForOperator(name, "a"); |
| 5370 } | 5379 } |
| 5371 } | 5380 } |
| OLD | NEW |