-
Notifications
You must be signed in to change notification settings - Fork 0
/
test19731.d
55 lines (46 loc) · 810 Bytes
/
test19731.d
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
// PERMUTE_ARGS:
struct Foo
{
Object obj_;
invariant (obj_ !is null);
auto obj7()
{
return this.obj_;
}
enum compiles = __traits(compiles, &Foo.init.obj7);
}
class Foo2
{
Object obj_;
invariant (obj_ !is null);
final auto obj7()
{
return this.obj_;
}
enum compiles = __traits(compiles, &Foo.init.obj7);
}
void main()
{
import core.exception : AssertError;
Foo foo = Foo();
Foo2 foo2 = new Foo2();
try
{
foo.obj7.toString();
}
catch(AssertError)
{
try
{
foo2.obj7.toString();
}
catch(AssertError)
{
foo.obj_ = new Object();
foo2.obj_ = new Object();
return;
}
assert(0);
}
assert(0);
}