Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(988)

Side by Side Diff: pkg/analyzer/test/src/dart/analysis/driver_test.dart

Issue 2956923003: Fix for crash because of missing type of default generic function typed parameters. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/declaration_resolver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 class A { 1316 class A {
1317 int foo( bar<T extends B>() ) {} 1317 int foo( bar<T extends B>() ) {}
1318 } 1318 }
1319 class B {} 1319 class B {}
1320 '''); 1320 ''');
1321 1321
1322 AnalysisResult result = await driver.getResult(testFile); 1322 AnalysisResult result = await driver.getResult(testFile);
1323 expect(result.path, testFile); 1323 expect(result.path, testFile);
1324 } 1324 }
1325 1325
1326 test_getResult_genericFunctionType_parameter_named() async {
1327 String content = '''
1328 class C {
1329 test({bool Function(String) p}) {}
1330 }
1331 ''';
1332 addTestFile(content, priority: true);
1333
1334 var result = await driver.getResult(testFile);
1335 expect(result.errors, isEmpty);
1336 }
1337
1326 test_getResult_inferTypes_finalField() async { 1338 test_getResult_inferTypes_finalField() async {
1327 addTestFile( 1339 addTestFile(
1328 r''' 1340 r'''
1329 class C { 1341 class C {
1330 final f = 42; 1342 final f = 42;
1331 } 1343 }
1332 ''', 1344 ''',
1333 priority: true); 1345 priority: true);
1334 await scheduler.waitForIdle(); 1346 await scheduler.waitForIdle();
1335 1347
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 var path = _p('/test.dart'); 2800 var path = _p('/test.dart');
2789 expect(() { 2801 expect(() {
2790 driver.removeFile(path); 2802 driver.removeFile(path);
2791 }, throwsStateError); 2803 }, throwsStateError);
2792 } 2804 }
2793 2805
2794 String _p(String path) => provider.convertPath(path); 2806 String _p(String path) => provider.convertPath(path);
2795 } 2807 }
2796 2808
2797 class _SourceMock extends TypedMock implements Source {} 2809 class _SourceMock extends TypedMock implements Source {}
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/declaration_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698