|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a
|
3 | 3 | // BSD-style license that can be found in the LICENSE file.
|
4 | 4 |
|
| 5 | +import 'package:analyzer/dart/analysis/features.dart'; |
5 | 6 | import 'package:analyzer/dart/ast/ast.dart';
|
6 | 7 | import 'package:analyzer/src/dart/resolver/exit_detector.dart';
|
| 8 | +import 'package:analyzer/src/generated/engine.dart'; |
7 | 9 | import 'package:analyzer/src/test_utilities/find_node.dart';
|
8 | 10 | import 'package:test/test.dart';
|
9 | 11 | import 'package:test_reflective_loader/test_reflective_loader.dart';
|
@@ -143,6 +145,11 @@ void f() { // ref
|
143 | 145 | /// See [ExitDetectorResolvedStatementTest] for tests that require the AST to be resolved.
|
144 | 146 | @reflectiveTest
|
145 | 147 | class ExitDetectorParsedStatementTest extends ParseBase {
|
| 148 | + @override |
| 149 | + AnalysisOptionsImpl get analysisOptions => AnalysisOptionsImpl() |
| 150 | + ..contextFeatures = FeatureSet.forTesting( |
| 151 | + sdkVersion: '2.13', additionalFeatures: [Feature.constructor_tearoffs]); |
| 152 | + |
146 | 153 | test_asExpression() async {
|
147 | 154 | _assertFalse('a as Object;');
|
148 | 155 | }
|
@@ -514,6 +521,18 @@ class ExitDetectorParsedStatementTest extends ParseBase {
|
514 | 521 | _assertTrue("(throw 42)(g);");
|
515 | 522 | }
|
516 | 523 |
|
| 524 | + test_functionReference() async { |
| 525 | + _assertFalse('a<int>;'); |
| 526 | + } |
| 527 | + |
| 528 | + test_functionReference_method() async { |
| 529 | + _assertFalse('(a).m<int>;'); |
| 530 | + } |
| 531 | + |
| 532 | + test_functionReference_method_throw() async { |
| 533 | + _assertTrue('(throw 42).m<int>;'); |
| 534 | + } |
| 535 | + |
517 | 536 | test_identifier_prefixedIdentifier() async {
|
518 | 537 | _assertFalse('a.b;');
|
519 | 538 | }
|
|
0 commit comments