| 1 |
module test8717; |
| 2 |
|
| 3 |
struct SPR |
| 4 |
{ |
| 5 |
private: |
| 6 |
enum e = 1; |
| 7 |
immutable int ii = 1; |
| 8 |
immutable static int sii = 1; |
| 9 |
static int sf() { return 1; } |
| 10 |
int f() const { return 1; } |
| 11 |
} |
| 12 |
|
| 13 |
static assert(SPR.e == 1); |
| 14 |
//static assert(SPR.ii == 1); |
| 15 |
static assert(SPR.sii == 1); |
| 16 |
static assert(SPR.sf() == 1); |
| 17 |
static assert(SPR.init.e == 1); |
| 18 |
static assert(SPR.init.ii == 1); |
| 19 |
static assert(SPR.init.sii == 1); |
| 20 |
static assert(SPR.sf() == 1); |
| 21 |
static assert(SPR.init.f() == 1); |
| 22 |
|
| 23 |
static if(SPR.e != 1) { static assert(0); } |
| 24 |
//static if(SPR.ii != 1) { static assert(0); } |
| 25 |
static if(SPR.sii != 1) { static assert(0); } |
| 26 |
static if(SPR.sf() != 1) { static assert(0); } |
| 27 |
static if(SPR.init.e != 1) { static assert(0); } |
| 28 |
static if(SPR.init.ii != 1) { static assert(0); } |
| 29 |
static if(SPR.init.sii != 1) { static assert(0); } |
| 30 |
static if(SPR.sf() != 1) { static assert(0); } |
| 31 |
static if(SPR.init.f() != 1) { static assert(0); } |
| 32 |
|
| 33 |
struct SPT |
| 34 |
{ |
| 35 |
protected: |
| 36 |
enum e = 1; |
| 37 |
immutable int ii = 1; |
| 38 |
immutable static int sii = 1; |
| 39 |
static int sf() { return 1; } |
| 40 |
int f() const { return 1; } |
| 41 |
} |
| 42 |
|
| 43 |
static assert(SPT.e == 1); |
| 44 |
//static assert(SPT.ii == 1); |
| 45 |
static assert(SPT.sii == 1); |
| 46 |
static assert(SPT.sf() == 1); |
| 47 |
static assert(SPT.init.e == 1); |
| 48 |
static assert(SPT.init.ii == 1); |
| 49 |
static assert(SPT.init.sii == 1); |
| 50 |
static assert(SPT.sf() == 1); |
| 51 |
static assert(SPT.init.f() == 1); |
| 52 |
|
| 53 |
static if(SPT.e != 1) { static assert(0); } |
| 54 |
//static if(SPT.ii != 1) { static assert(0); } |
| 55 |
static if(SPT.sii != 1) { static assert(0); } |
| 56 |
static if(SPT.sf() != 1) { static assert(0); } |
| 57 |
static if(SPT.init.e != 1) { static assert(0); } |
| 58 |
static if(SPT.init.ii != 1) { static assert(0); } |
| 59 |
static if(SPT.init.sii != 1) { static assert(0); } |
| 60 |
static if(SPT.sf() != 1) { static assert(0); } |
| 61 |
static if(SPT.init.f() != 1) { static assert(0); } |
| 62 |
|
| 63 |
void main() { } |