OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Use qualified symbols at various places. | 5 // Use qualified symbols at various places. |
6 | 6 |
7 library Prefix14Test.dart; | 7 library Prefix14Test.dart; |
| 8 |
8 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
9 import "library12.dart" as lib12; | 10 import "library12.dart" as lib12; |
10 | 11 |
11 typedef lib12.Library12 myFunc(lib12.Library12 param); | 12 typedef lib12.Library12 myFunc(lib12.Library12 param); |
12 | 13 |
13 class myInterface implements lib12.Library12Interface { | 14 class myInterface implements lib12.Library12Interface { |
14 myInterface(lib12.Library12 this.myfld); | 15 myInterface(lib12.Library12 this.myfld); |
15 lib12.Library12 addObjects(lib12.Library12 value1, lib12.Library12 value2) { | 16 lib12.Library12 addObjects(lib12.Library12 value1, lib12.Library12 value2) { |
16 myfld.fld = (value1.fld + value2.fld + myfld.fld); | 17 myfld.fld = (value1.fld + value2.fld + myfld.fld); |
17 return myfld; | 18 return myfld; |
18 } | 19 } |
| 20 |
19 lib12.Library12 myfld; | 21 lib12.Library12 myfld; |
20 } | 22 } |
21 | 23 |
22 | |
23 class myClass extends lib12.Library12 { | 24 class myClass extends lib12.Library12 { |
24 myClass(int value) : super(value); | 25 myClass(int value) : super(value); |
25 static lib12.Library12 func1() { | 26 static lib12.Library12 func1() { |
26 var i = new lib12.Library12(10); | 27 var i = new lib12.Library12(10); |
27 return i; | 28 return i; |
28 } | 29 } |
| 30 |
29 static lib12.Library12 func2(lib12.Library12 param) { | 31 static lib12.Library12 func2(lib12.Library12 param) { |
30 return param; | 32 return param; |
31 } | 33 } |
32 } | 34 } |
33 | 35 |
34 class myClass1 { | 36 class myClass1 { |
35 myClass1(int value) : fld1 = new lib12.Library12(value); | 37 myClass1(int value) : fld1 = new lib12.Library12(value); |
36 lib12.Library12 fld1; | 38 lib12.Library12 fld1; |
37 } | 39 } |
38 | 40 |
(...skipping 20 matching lines...) Expand all Loading... |
59 Expect.equals(2, o.fld2.func()); | 61 Expect.equals(2, o.fld2.func()); |
60 Expect.equals(200, o.fld2.fld); | 62 Expect.equals(200, o.fld2.fld); |
61 | 63 |
62 o = new myInterface(new lib12.Library12(100)); | 64 o = new myInterface(new lib12.Library12(100)); |
63 Expect.equals(2, o.myfld.func()); | 65 Expect.equals(2, o.myfld.func()); |
64 Expect.equals(100, o.myfld.fld); | 66 Expect.equals(100, o.myfld.fld); |
65 o = o.addObjects(new lib12.Library12(200), new lib12.Library12(300)); | 67 o = o.addObjects(new lib12.Library12(200), new lib12.Library12(300)); |
66 Expect.equals(2, o.func()); | 68 Expect.equals(2, o.func()); |
67 Expect.equals(600, o.fld); | 69 Expect.equals(600, o.fld); |
68 } | 70 } |
OLD | NEW |