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

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

Issue 2832893002: Issue 29398. Infer instance members using InheritanceManager of the ClassElement. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/src/dart/analysis/driver.dart'; 8 import 'package:analyzer/src/dart/analysis/driver.dart';
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; 9 import 'package:test_reflective_loader/test_reflective_loader.dart';
10 10
(...skipping 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 V m(K a); 2660 V m(K a);
2661 } 2661 }
2662 abstract class B<T1, T2> extends A<T2, T1> { 2662 abstract class B<T1, T2> extends A<T2, T1> {
2663 } 2663 }
2664 class C implements B<int, String> { 2664 class C implements B<int, String> {
2665 int m(String a) {} 2665 int m(String a) {}
2666 } 2666 }
2667 '''); 2667 ''');
2668 } 2668 }
2669 2669
2670 test_method_OK_single_private_linkThroughOtherLibraryOfCycle() async {
2671 String path = _p('/other.dart');
2672 provider.newFile(
2673 path,
2674 r'''
2675 import 'test.dart';
2676 class B extends A2 {}
2677 ''');
2678 var library = await _encodeDecodeLibrary(r'''
2679 import 'other.dart';
2680 class A1 {
2681 int _foo() => 1;
2682 }
2683 class A2 extends A1 {
2684 _foo() => 2;
2685 }
2686 ''');
2687 checkElementText(
2688 library,
2689 r'''
2690 import 'other.dart';
2691 class A1 {
2692 int _foo() {}
2693 }
2694 class A2 extends A1 {
2695 int _foo() {}
2696 }
2697 ''');
2698 }
2699
2670 test_method_OK_single_withExtends_notGeneric() async { 2700 test_method_OK_single_withExtends_notGeneric() async {
2671 var library = await _encodeDecodeLibrary(r''' 2701 var library = await _encodeDecodeLibrary(r'''
2672 class A { 2702 class A {
2673 String m(int a) {} 2703 String m(int a) {}
2674 } 2704 }
2675 class B extends Object with A { 2705 class B extends Object with A {
2676 m(a) {} 2706 m(a) {}
2677 } 2707 }
2678 '''); 2708 ''');
2679 checkElementText( 2709 checkElementText(
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 2775
2746 Future<LibraryElement> _encodeDecodeLibrary(String text) async { 2776 Future<LibraryElement> _encodeDecodeLibrary(String text) async {
2747 String path = _p('/test.dart'); 2777 String path = _p('/test.dart');
2748 provider.newFile(path, text); 2778 provider.newFile(path, text);
2749 UnitElementResult result = await driver.getUnitElement(path); 2779 UnitElementResult result = await driver.getUnitElement(path);
2750 return result.element.library; 2780 return result.element.library;
2751 } 2781 }
2752 2782
2753 String _p(String path) => provider.convertPath(path); 2783 String _p(String path) => provider.convertPath(path);
2754 } 2784 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | pkg/analyzer/test/src/task/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698