OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 library test.declarations_model; | |
6 | |
7 var libraryVariable; | |
8 get libraryGetter => null; | |
9 set librarySetter(x) => x; | |
10 libraryMethod() => null; | |
11 | |
12 typedef bool Predicate(dynamic); | |
gbracha
2013/12/20 19:05:40
You could write Predicate(Object) here and it woul
| |
13 | |
14 abstract class Interface<I> { | |
15 operator /(x) => null; | |
16 | |
17 var interfaceInstanceVariable; | |
18 get interfaceInstanceGetter; | |
19 set interfaceInstanceSetter(x); | |
20 interfaceInstanceMethod(); | |
21 | |
22 static var interfaceStaticVariable; | |
23 static get interfaceStaticGetter => null; | |
24 static set interfaceStaticSetter(x) => x; | |
25 static interfaceStaticMethod() => null; | |
26 } | |
27 | |
28 class Superclass<S> { | |
29 operator -(x) => null; | |
30 | |
31 var inheritedInstanceVariable; | |
32 get inheritedInstanceGetter => null; | |
33 set inheritedInstanceSetter(x) => x; | |
34 inheritedInstanceMethod() => null; | |
35 | |
36 static var inheritedStaticVariable; | |
37 static get inheritedStaticGetter => null; | |
38 static set inheritedStaticSetter(x) => x; | |
39 static inheritedStaticMethod() => null; | |
40 | |
41 Superclass.inheritedGenerativeConstructor(this.inheritedInstanceVariable); | |
42 Superclass.inheritedRedirectingConstructor(x) | |
43 : this.inheritedGenerativeConstructor(x*2); | |
44 factory Superclass.inheritedNormalFactory(y) | |
45 => new Superclass.inheritedRedirectingConstructor(y*3); | |
46 factory Superclass.inheritedRedirectingFactory(z) | |
47 = Superclass.inheritedNormalFactory; | |
48 } | |
49 | |
50 abstract class Class<C> | |
51 extends Superclass<C> implements Interface<C> { | |
gbracha
2013/12/20 19:05:40
Doesn't the analyzer complain that / is not implem
| |
52 operator +(x) => null; | |
53 | |
54 abstractMethod(); | |
55 | |
56 var instanceVariable; | |
57 get instanceGetter => null; | |
58 set instanceSetter(x) => x; | |
59 instanceMethod() => null; | |
60 | |
61 static var staticVariable; | |
62 static get staticGetter => null; | |
63 static set staticSetter(x) => x; | |
64 static staticMethod() => null; | |
65 | |
66 Class.generativeConstructor(this.instanceVariable) | |
67 : super.inheritedGenerativeConstructor(0); | |
68 Class.redirectingConstructor(x) | |
69 : this.generativeConstructor(x*2); | |
70 factory Class.normalFactory(y) => new ConcreteClass(y*3); | |
71 factory Class.redirectingFactory(z) = Class.normalFactory; | |
72 } | |
73 | |
74 // This is just here as a target of Class's factories to appease the analyzer. | |
75 class ConcreteClass<CC> extends Class<CC> { | |
76 abstractMethod() {} | |
77 | |
78 operator /(x) => null; | |
79 | |
80 var interfaceInstanceVariable; | |
81 get interfaceInstanceGetter => null; | |
82 set interfaceInstanceSetter(x) => null; | |
83 interfaceInstanceMethod() => null; | |
84 | |
85 ConcreteClass(x) : super.generativeConstructor(x); | |
86 } | |
OLD | NEW |