1 module modules.types; 2 3 4 struct String { 5 string value; 6 } 7 8 9 enum Enum { 10 foo, 11 bar, 12 baz, 13 } 14 15 class Class { 16 int i; 17 this(int i) { this.i = i; } 18 } 19 20 21 interface Interface { 22 int foo(double d, string s); 23 } 24 25 class AbstractClass { 26 abstract double bar(int i); 27 } 28 29 class MiddleClass: AbstractClass { 30 string baz(string s); 31 } 32 33 class LeafClass: MiddleClass, Interface { 34 override int foo(double d, string s) { 35 return 42; 36 } 37 38 override double bar(int i) { 39 return i * 2; 40 } 41 42 override string baz(string s) { 43 return s ~ "_baz"; 44 } 45 } 46 47 48 // just to test this gets ignored 49 int func(string s, double d) { 50 return 42; 51 } 52 53 54 struct Point { 55 double x, y; 56 } 57 58 59 struct Inner1 { 60 Point point; 61 double value; 62 } 63 64 65 struct EvenInner { 66 double value; 67 } 68 69 70 struct Inner2 { 71 EvenInner evenInner; 72 } 73 74 75 struct Outer { 76 Inner1[] inner1s; 77 Inner2 inner2; 78 } 79 80 81 enum Char: char { 82 a = 'a', 83 b = 'b', 84 } 85 86 union Union { 87 88 }