1 // https://issues.dlang.org/show_bug.cgi?id=17955
5 fail_compilation/fail17955.d(81): Error: cannot create instance of abstract class `SimpleTimeZone`
6 fail_compilation/fail17955.d(81): function `bool hasDST()` is not implemented
7 fail_compilation/fail17955.d(93): Error: template instance `fail17955.SimpleTimeZone.fromISOExtString!dstring` error instantiating
8 fail_compilation/fail17955.d(25): instantiated from here: `fromISOExtString!string`
9 fail_compilation/fail17955.d(56): instantiated from here: `isISOExtStringSerializable!(SysTime)`
10 fail_compilation/fail17955.d(49): instantiated from here: `toRedis!(SysTime)`
11 fail_compilation/fail17955.d(40): ... (2 instantiations, -v to show) ...
12 fail_compilation/fail17955.d(32): instantiated from here: `indicesOf!(isRedisType, resetCodeExpireTime)`
13 fail_compilation/fail17955.d(67): instantiated from here: `RedisStripped!(User, true)`
14 fail_compilation/fail17955.d(93): Error: need `this` for `fromISOExtString` of type `pure nothrow @nogc @safe immutable(SimpleTimeZone)(dstring _param_0)`
15 fail_compilation/fail17955.d(95): Error: undefined identifier `DateTimeException`
16 fail_compilation/fail17955.d(25): Error: variable `fail17955.isISOExtStringSerializable!(SysTime).isISOExtStringSerializable` - type `void` is inferred from initializer `fromISOExtString("")`, and variables cannot be of type `void`
17 fail_compilation/fail17955.d(54): Error: function `fail17955.toRedis!(SysTime).toRedis` has no `return` statement, but is expected to return a value of type `string`
21 alias Alias(alias a
) = a
;
23 template isISOExtStringSerializable(T
)
25 enum isISOExtStringSerializable
= T
.fromISOExtString("");
28 template RedisObjectCollection(){}
30 struct RedisStripped(T
, bool strip_id
= true)
32 alias unstrippedMemberIndices
= indicesOf
!(Select
!(strip_id
,
33 isRedisTypeAndNotID
, isRedisType
), T
.tupleof
);
36 template indicesOf(alias PRED
, T
...)
38 template impl(size_t i
)
44 alias indicesOf
= impl
!0;
47 template isRedisType(alias F
)
49 enum isRedisType
= toRedis
!(typeof(F
));
52 template isRedisTypeAndNotID(){}
56 static if (isISOExtStringSerializable
!T
)
62 SysTime resetCodeExpireTime
;
65 class RedisUserManController
67 RedisObjectCollection
!(RedisStripped
!User
) m_users
;
72 abstract bool hasDST();
75 class SimpleTimeZone
: TimeZone
79 immutable(SimpleTimeZone
) fromISOExtString(S
)(S
)
88 static fromISOExtString(S
)(S
)
93 SimpleTimeZone
.fromISOExtString(zoneStr
);
95 catch (DateTimeException e
) {}
99 template Select(bool condition
, T
...)
101 alias Select
= Alias
!(T
[condition
]);