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

Side by Side Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 2655713002: Fix prelinker when a local name shadows an import prefix. (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/test/generated/compile_time_error_code_driver_test.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.src.summary.summary_common; 5 library analyzer.test.src.summary.summary_common;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/error/listener.dart'; 9 import 'package:analyzer/error/listener.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 8862 matching lines...) Expand 10 before | Expand all | Expand 10 after
8873 addNamedSource('/a.dart', 'class C {} class D {}'); 8873 addNamedSource('/a.dart', 'class C {} class D {}');
8874 serializeLibraryText(''' 8874 serializeLibraryText('''
8875 import 'a.dart'; 8875 import 'a.dart';
8876 class C {} 8876 class C {}
8877 C c; 8877 C c;
8878 D d;'''); 8878 D d;''');
8879 checkTypeRef(findVariable('c').type, null, null, 'C'); 8879 checkTypeRef(findVariable('c').type, null, null, 'C');
8880 checkTypeRef(findVariable('d').type, absUri('/a.dart'), 'a.dart', 'D'); 8880 checkTypeRef(findVariable('d').type, absUri('/a.dart'), 'a.dart', 'D');
8881 } 8881 }
8882 8882
8883 test_localNameShadowsImportPrefix() {
8884 serializeLibraryText('import "dart:async" as a; class a {}; a x;');
8885 checkTypeRef(findVariable('x').type, null, null, 'a');
8886 }
8887
8883 test_metadata_classDeclaration() { 8888 test_metadata_classDeclaration() {
8884 checkAnnotationA( 8889 checkAnnotationA(
8885 serializeClassText('const a = null; @a class C {}').annotations); 8890 serializeClassText('const a = null; @a class C {}').annotations);
8886 } 8891 }
8887 8892
8888 test_metadata_classTypeAlias() { 8893 test_metadata_classTypeAlias() {
8889 checkAnnotationA(serializeClassText( 8894 checkAnnotationA(serializeClassText(
8890 'const a = null; @a class C = D with E; class D {} class E {}', 8895 'const a = null; @a class C = D with E; class D {} class E {}',
8891 className: 'C') 8896 className: 'C')
8892 .annotations); 8897 .annotations);
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
10612 class _PrefixExpectation { 10617 class _PrefixExpectation {
10613 final ReferenceKind kind; 10618 final ReferenceKind kind;
10614 final String name; 10619 final String name;
10615 final String absoluteUri; 10620 final String absoluteUri;
10616 final String relativeUri; 10621 final String relativeUri;
10617 final int numTypeParameters; 10622 final int numTypeParameters;
10618 10623
10619 _PrefixExpectation(this.kind, this.name, 10624 _PrefixExpectation(this.kind, this.name,
10620 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 10625 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
10621 } 10626 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698