1    private@
2    
3    type A @abstract =
4        let x = 5
5        let x_squared () = x * x
6    
7        def f : String
8    
9    mixin B =
10       require A
11   
12       let x_cubed () = x_squared * x
13   
14       def A.f = "B"
15   
16   type C =
17       inherit A
18       include B
19   
20   do
21       let c = C.new
22       let cubed = c.x_cubed
23       assert cubed == 125
24   
25       let s = c.f
26       assert s == "B"
27   
28   type D @abstract
29   
30   let g (d : D) = ()
31   
32   mixin E =
33       require D
34   
35       g self
36   
37   type F =
38       inherit D
39   
40   mixin G =
41       require F
42   
43       g self
44