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

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

Issue 2676713002: Fix for 'The getter 'isDynamic' was called on null' because of dartbug.com/28515 (Closed)
Patch Set: Created 3 years, 10 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 library analyzer.test.driver; 5 library analyzer.test.driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 855
856 var result = await driver.getResult(a); 856 var result = await driver.getResult(a);
857 857
858 // The content that was set into the overlay for "b" should be visible 858 // The content that was set into the overlay for "b" should be visible
859 // through the AnalysisContext that was used to analyze "a". 859 // through the AnalysisContext that was used to analyze "a".
860 CompilationUnitElement unitA = result.unit.element; 860 CompilationUnitElement unitA = result.unit.element;
861 Source sourceB = unitA.library.imports[0].importedLibrary.source; 861 Source sourceB = unitA.library.imports[0].importedLibrary.source;
862 expect(unitA.context.getContents(sourceB).data, 'var v = 2;'); 862 expect(unitA.context.getContents(sourceB).data, 'var v = 2;');
863 } 863 }
864 864
865 test_getResult_functionTypeFormalParameter_withTypeParameter() async {
866 // This was code crashing because of incomplete implementation.
867 // Consider (re)moving after fixing dartbug.com/28515
868 addTestFile(r'''
869 class A {
870 int foo( bar<T extends B>() ) {}
871 }
872 class B {}
873 ''');
874
875 AnalysisResult result = await driver.getResult(testFile);
876 expect(result.path, testFile);
877 }
878
865 test_getResult_inferTypes_finalField() async { 879 test_getResult_inferTypes_finalField() async {
866 addTestFile( 880 addTestFile(
867 r''' 881 r'''
868 class C { 882 class C {
869 final f = 42; 883 final f = 42;
870 } 884 }
871 ''', 885 ''',
872 priority: true); 886 priority: true);
873 await scheduler.waitForIdle(); 887 await scheduler.waitForIdle();
874 888
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 * Return the [provider] specific path for the given Posix [path]. 2065 * Return the [provider] specific path for the given Posix [path].
2052 */ 2066 */
2053 String _p(String path) => provider.convertPath(path); 2067 String _p(String path) => provider.convertPath(path);
2054 2068
2055 static String _md5(String content) { 2069 static String _md5(String content) {
2056 return hex.encode(md5.convert(UTF8.encode(content)).bytes); 2070 return hex.encode(md5.convert(UTF8.encode(content)).bytes);
2057 } 2071 }
2058 } 2072 }
2059 2073
2060 class _SourceMock extends TypedMock implements Source {} 2074 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