1 module issues; 2 3 4 import extra: String; 5 6 struct Uncopiable { 7 @disable this(this); 8 double x; 9 } 10 11 /** 12 Here to make sure it's not wrapped and doesn't cause problems. 13 See #10. 14 */ 15 export auto uncopiable() { 16 return Uncopiable.init; 17 } 18 19 20 export auto uncopiablePtr(double d = 33.3) { 21 return new Uncopiable(d); 22 } 23 24 25 export auto stringPtr(string s) { 26 static struct StringPtrRetStruct { 27 string value; 28 } 29 return new StringPtrRetStruct(s); 30 } 31 32 33 // Generates symbols with two leading underscores 34 struct DoubleUnderscore { 35 static struct Inner { 36 this(this) {} 37 ~this() {} 38 } 39 40 Inner inner; 41 42 this(this) { } 43 ~this() {} 44 } 45 46 47 struct IssueString { 48 string value; 49 this(string value) { this.value = value; } 50 } 51 52 export void takesInString(in IssueString str) { 53 54 } 55 56 export void takesScopeString(scope IssueString str) { 57 58 } 59 60 export void takesRefString(ref IssueString str) { 61 62 } 63 64 65 export void takesRefConstString(ref const(IssueString) str) { 66 67 } 68 69 70 export ref const(IssueString) returnsRefConstString() { 71 static IssueString ret = IssueString("quux"); 72 return ret; 73 } 74 75 76 export const(IssueString) returnsConstString() { 77 return const IssueString("quux"); 78 } 79 80 81 export extern(C) int cAdd(int i, int j) { 82 return i + j; 83 } 84 85 86 export extern(C++) int cppAdd(int i, int j) { 87 return i + j; 88 } 89 90 91 struct StaticMemberFunctions { 92 static int add(int i, int j) { 93 return i + j; 94 } 95 } 96 97 98 class Issue54 { 99 int i; 100 this(int i) { this.i = i; } 101 } 102 103 export void takesString(String str) { 104 105 }