File tree Expand file tree Collapse file tree 1 file changed +27
-45
lines changed Expand file tree Collapse file tree 1 file changed +27
-45
lines changed Original file line number Diff line number Diff line change 55
66abstract class Base {
77 a () {
8-
8+ print ( "base a()" );
99 }
10- b () {
1110
11+ b () {
12+ print ("base b()" );
1213 }
13- }
1414
15- class S extends Base {
16- a () {
17- print ("S.a" );
18- super .a ();
15+ c () {
16+ print ("base c()" );
1917 }
2018}
2119
2220class A extends Base {
2321 a () {
24- print ("A.a" );
25- super .a ();
22+ print ("A.a() " );
23+ // super.a();
2624 }
2725
2826 b () {
29- print ("A.b" );
30- super .b ();
31- }
32- }
33-
34- class A1 extends Base {
35- a () {
36- print ("A1.a" );
37- super .a ();
38- }
39-
40- b () {
41- print ("A1.b" );
27+ print ("A.b()" );
4228 super .b ();
4329 }
4430}
4531
4632class A2 extends Base {
4733 a () {
48- print ("A2.a" );
34+ print ("A2.a() " );
4935 super .a ();
5036 }
51-
52- b () {
53- print ("A2.b" );
54- super .b ();
55- }
5637}
5738
5839class B extends Base {
5940 a () {
60- print ("B.a" );
41+ print ("B.a() " );
6142 super .a ();
6243 }
6344
6445 b () {
65- print ("B.b" );
46+ print ("B.b() " );
6647 super .b ();
6748 }
6849
6950 c () {
70- print ("B.c " );
51+ print ("B.c()" );
52+ super .c ();
7153 }
7254}
7355
74- class T = B with A1 , A2 , A , S ;
56+ class G extends B with A , A2 {
57+
58+ }
7559
7660
7761testMixins () {
78- T t = new T ();
62+ G t = new G ();
7963 t.a ();
8064 t.b ();
8165 t.c ();
8266}
8367
84- /**
85- * I/flutter ( 1864): S.a
86- I/flutter ( 1864): A.a
87- I/flutter ( 1864): A2.a
88- I/flutter ( 1864): A1.a
89- I/flutter ( 1864): B.a
90- I/flutter ( 1864): A.b
91- I/flutter ( 1864): A2.b
92- I/flutter ( 1864): A1.b
93- I/flutter ( 1864): B.b
94- I/flutter ( 1864): B.c
95- * */
68+
69+ ///I/flutter (13627): A2.a()
70+ ///I/flutter (13627): A.a()
71+ ///I/flutter (13627): B.a()
72+ ///I/flutter (13627): base a()
73+ ///I/flutter (13627): A.b()
74+ ///I/flutter (13627): B.b()
75+ ///I/flutter (13627): base b()
76+ ///I/flutter (13627): B.c()
77+ ///I/flutter (13627): base c()
You can’t perform that action at this time.
0 commit comments