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

Unified Diff: pkg/analyzer/test/generated/inheritance_manager_test.dart

Issue 1951363003: Report when members indirectly inherited through a mixin are not implemented (issue 26411) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixed test failures Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/test/generated/static_warning_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/inheritance_manager_test.dart
diff --git a/pkg/analyzer/test/generated/inheritance_manager_test.dart b/pkg/analyzer/test/generated/inheritance_manager_test.dart
index e4f83950564bac13232ebea3eccc96ae7a4ebe1e..9e82a02edc499d6cba3879c31f813ea7e1925b8d 100644
--- a/pkg/analyzer/test/generated/inheritance_manager_test.dart
+++ b/pkg/analyzer/test/generated/inheritance_manager_test.dart
@@ -280,6 +280,32 @@ class InheritanceManagerTest {
_assertNoErrors(classB);
}
+ void test_getMapOfMembersInheritedFromInterfaces_field_indirectWith() {
+ // class A { int f; }
+ // class B extends A {}
+ // class C extends Object with B {}
+ ClassElementImpl classA = ElementFactory.classElement2('A');
+ String fieldName = "f";
+ FieldElement fieldF = ElementFactory.fieldElement(
+ fieldName, false, false, false, _typeProvider.intType);
+ classA.fields = <FieldElement>[fieldF];
+ classA.accessors = <PropertyAccessorElement>[fieldF.getter, fieldF.setter];
+
+ ClassElementImpl classB = ElementFactory.classElement('B', classA.type);
+
+ ClassElementImpl classC = ElementFactory.classElement2('C');
+ classC.mixins = <InterfaceType>[classB.type];
+
+ Map<String, ExecutableElement> mapC =
+ _inheritanceManager.getMembersInheritedFromInterfaces(classC);
+ expect(mapC.length, _numOfMembersInObject + 2);
scheglov 2016/05/06 17:59:47 expect(mapC, hasLength(_numOfMembersInObject + 2))
Brian Wilkerson 2016/05/06 18:25:36 Done
+ expect(mapC[fieldName], same(fieldF.getter));
+ expect(mapC['$fieldName='], same(fieldF.setter));
+ _assertNoErrors(classA);
+ _assertNoErrors(classB);
+ _assertNoErrors(classC);
+ }
+
void test_getMapOfMembersInheritedFromInterfaces_implicitExtends() {
// class A {}
ClassElementImpl classA = ElementFactory.classElement2("A");
@@ -869,6 +895,30 @@ class InheritanceManagerTest {
_assertNoErrors(classA);
}
+ void test_getMembersInheritedFromClasses_field_indirectWith() {
+ // class A { int f; }
+ // class B extends A {}
+ // class C extends Object with B {}
+ ClassElementImpl classA = ElementFactory.classElement2('A');
+ String fieldName = "f";
+ FieldElement fieldF = ElementFactory.fieldElement(
+ fieldName, false, false, false, _typeProvider.intType);
+ classA.fields = <FieldElement>[fieldF];
+ classA.accessors = <PropertyAccessorElement>[fieldF.getter, fieldF.setter];
+
+ ClassElementImpl classB = ElementFactory.classElement('B', classA.type);
+
+ ClassElementImpl classC = ElementFactory.classElement2('C');
+ classC.mixins = <InterfaceType>[classB.type];
+
+ Map<String, ExecutableElement> mapC =
+ _inheritanceManager.getMembersInheritedFromClasses(classC);
+ expect(mapC.length, _numOfMembersInObject);
scheglov 2016/05/06 17:59:47 expect(mapC, hasLength(_numOfMembersInObject));
Brian Wilkerson 2016/05/06 18:25:36 Done
+ _assertNoErrors(classA);
+ _assertNoErrors(classB);
+ _assertNoErrors(classC);
+ }
+
void test_lookupInheritance_interface_getter() {
ClassElementImpl classA = ElementFactory.classElement2("A");
String getterName = "g";
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/test/generated/static_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698