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

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

Issue 2678273007: When a name is both exported and defined locally, the name is defined. (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/summary/prelink.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 test.src.serialization.elements_test; 5 library test.src.serialization.elements_test;
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/constant/value.dart'; 9 import 'package:analyzer/dart/constant/value.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 4378 matching lines...) Expand 10 before | Expand all | Expand 10 after
4389 test_method_type_parameter_in_generic_class() { 4389 test_method_type_parameter_in_generic_class() {
4390 prepareAnalysisContext(createOptions()); 4390 prepareAnalysisContext(createOptions());
4391 checkLibrary('class C<T, U> { V f<V, W>(T t, U u, W w) => null; }'); 4391 checkLibrary('class C<T, U> { V f<V, W>(T t, U u, W w) => null; }');
4392 } 4392 }
4393 4393
4394 test_method_type_parameter_with_function_typed_parameter() { 4394 test_method_type_parameter_with_function_typed_parameter() {
4395 prepareAnalysisContext(createOptions()); 4395 prepareAnalysisContext(createOptions());
4396 checkLibrary('class C { void f<T, U>(T x(U u)) {} }'); 4396 checkLibrary('class C { void f<T, U>(T x(U u)) {} }');
4397 } 4397 }
4398 4398
4399 test_nameConflict_exportedAndLocal() {
4400 namesThatCannotBeResolved.add('V');
4401 addLibrarySource('/a.dart', 'class C {}');
4402 addLibrarySource(
4403 '/c.dart',
4404 '''
4405 export 'a.dart';
4406 class C {}
4407 ''');
4408 checkLibrary('''
4409 import 'c.dart';
4410 C v = null;
4411 ''');
4412 }
4413
4414 test_nameConflict_exportedAndParted() {
4415 namesThatCannotBeResolved.add('V');
4416 addLibrarySource('/a.dart', 'class C {}');
4417 addLibrarySource(
4418 '/b.dart',
4419 '''
4420 part of lib;
4421 class C {}
4422 ''');
4423 addLibrarySource(
4424 '/c.dart',
4425 '''
4426 library lib;
4427 export 'a.dart';
4428 part 'b.dart';
4429 ''');
4430 checkLibrary('''
4431 import 'c.dart';
4432 C v = null;
4433 ''');
4434 }
4435
4399 test_nested_generic_functions_in_generic_class_with_function_typed_params() { 4436 test_nested_generic_functions_in_generic_class_with_function_typed_params() {
4400 checkLibrary(''' 4437 checkLibrary('''
4401 class C<T, U> { 4438 class C<T, U> {
4402 void g<V, W>() { 4439 void g<V, W>() {
4403 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) { 4440 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) {
4404 } 4441 }
4405 } 4442 }
4406 } 4443 }
4407 '''); 4444 ''');
4408 } 4445 }
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
5204 fail('Unexpectedly tried to get unlinked summary for $uri'); 5241 fail('Unexpectedly tried to get unlinked summary for $uri');
5205 } 5242 }
5206 return serializedUnit; 5243 return serializedUnit;
5207 } 5244 }
5208 5245
5209 @override 5246 @override
5210 bool hasLibrarySummary(String uri) { 5247 bool hasLibrarySummary(String uri) {
5211 return true; 5248 return true;
5212 } 5249 }
5213 } 5250 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/prelink.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698