1 // https://issues.dlang.org/show_bug.cgi?id=17955
5 fail_compilation/fail17955.d(82): Error: cannot create instance of abstract class `SimpleTimeZone`
6 fail_compilation/fail17955.d(76): class `SimpleTimeZone` is declared here
7 fail_compilation/fail17955.d(73): function `bool hasDST()` is not implemented
8 fail_compilation/fail17955.d(94): Error: template instance `fail17955.SimpleTimeZone.fromISOExtString!dstring` error instantiating
9 fail_compilation/fail17955.d(26): instantiated from here: `fromISOExtString!string`
10 fail_compilation/fail17955.d(57): instantiated from here: `isISOExtStringSerializable!(SysTime)`
11 fail_compilation/fail17955.d(50): instantiated from here: `toRedis!(SysTime)`
12 fail_compilation/fail17955.d(41): ... (2 instantiations, -v to show) ...
13 fail_compilation/fail17955.d(33): instantiated from here: `indicesOf!(isRedisType, resetCodeExpireTime)`
14 fail_compilation/fail17955.d(68): instantiated from here: `RedisStripped!(User, true)`
15 fail_compilation/fail17955.d(94): Error: calling non-static function `fromISOExtString` requires an instance of type `SimpleTimeZone`
16 fail_compilation/fail17955.d(96): Error: undefined identifier `DateTimeException`
17 fail_compilation/fail17955.d(26): Error: variable `fail17955.isISOExtStringSerializable!(SysTime).isISOExtStringSerializable` - type `void` is inferred from initializer `fromISOExtString("")`, and variables cannot be of type `void`
18 fail_compilation/fail17955.d(55): Error: function `fail17955.toRedis!(SysTime).toRedis` has no `return` statement, but is expected to return a value of type `string`
22 alias Alias(alias a
) = a
;
24 template isISOExtStringSerializable(T
)
26 enum isISOExtStringSerializable
= T
.fromISOExtString("");
29 template RedisObjectCollection(){}
31 struct RedisStripped(T
, bool strip_id
= true)
33 alias unstrippedMemberIndices
= indicesOf
!(Select
!(strip_id
,
34 isRedisTypeAndNotID
, isRedisType
), T
.tupleof
);
37 template indicesOf(alias PRED
, T
...)
39 template impl(size_t i
)
45 alias indicesOf
= impl
!0;
48 template isRedisType(alias F
)
50 enum isRedisType
= toRedis
!(typeof(F
));
53 template isRedisTypeAndNotID(){}
57 static if (isISOExtStringSerializable
!T
)
63 SysTime resetCodeExpireTime
;
66 class RedisUserManController
68 RedisObjectCollection
!(RedisStripped
!User
) m_users
;
73 abstract bool hasDST();
76 class SimpleTimeZone
: TimeZone
80 immutable(SimpleTimeZone
) fromISOExtString(S
)(S
)
89 static fromISOExtString(S
)(S
)
94 SimpleTimeZone
.fromISOExtString(zoneStr
);
96 catch (DateTimeException e
) {}
100 template Select(bool condition
, T
...)
102 alias Select
= Alias
!(T
[condition
]);