1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
// PERMUTE_ARGS:
// REQUIRED_ARGS: -o- -X -Xf${RESULTS_DIR}/compilable/json.out
// POST_SCRIPT: compilable/extra-files/json-postscript.sh
// EXTRA_FILES: imports/jsonimport1.d imports/jsonimport2.d imports/jsonimport3.d imports/jsonimport4.d
module json;
static this() {}
static ~this() {}
alias int myInt;
myInt x; // bug 3404
struct Foo(T) { T t; }
class Bar(int T) { int t = T; }
interface Baz(T...) { T[0] t() const; } // bug 3466
template P(alias T) {}
class Bar2 : Bar!1, Baz!(int, 2, null) {
this() {}
~this() {} // bug 4178
static foo() {}
protected abstract Foo!int baz();
override int t() const { return 0; }
}
class Bar3 : Bar2 {
private int val;
this(int i) { val = i; }
protected override Foo!int baz() { return Foo!int(val); }
}
struct Foo2 {
Bar2 bar2;
union U {
struct {
short s;
int i;
}
Object o;
}
}
/++
+ Documentation test
+/
@trusted myInt bar(ref uint blah, Bar2 foo = new Bar3(7)) // bug 4477
{
return -1;
}
@property int outer() nothrow
in {
assert(true);
}
out(result) {
assert(result == 18);
}
body {
int x = 8;
int inner(void* v) nothrow
{
int y = 2;
assert(true);
return x + y;
}
int z = inner(null);
return x + z;
}
/** Issue 9484 - selective and renamed imports */
import imports.jsonimport1 : target1, target2;
import imports.jsonimport2 : alias1 = target1, alias2 = target2;
import imports.jsonimport3 : alias3 = target1, alias4 = target2, target3;
import imports.jsonimport4;
struct S
{
/** Issue 9480 - Template name should be stripped of parameters */
this(T)(T t) { }
}
/** Issue 9755 - Protection not emitted properly for Templates. */
private struct S1_9755(T) { }
package struct S2_9755(T) { }
class C_9755
{
protected static class CI_9755(T) { }
}
/** Issue 10011 - init property is wrong for object initializer. */
const Object c_10011 = new Object();
///
enum Numbers
{
unspecified1,
one = 2,
two = 3,
FILE_NOT_FOUND = 101,
unspecified3,
unspecified4,
four = 4,
}
template IncludeConstraint(T) if (T == string) {}
static foreach(enum i; 0..3)
{
mixin("int a" ~ i.stringof ~ " = 1;");
}
alias Seq(T...) = T;
static foreach(int i, alias a; Seq!(a0, a1, a2))
{
mixin("alias b" ~ i.stringof ~ " = a;");
}
mixin template test18211(int n)
{
static foreach (i; 0 .. n>10 ? 10 : n)
{
mixin("enum x" ~ cast(char)('0' + i));
}
static if (true) {}
}
|