Bug 20315 – checkaction=context fails for const(void[]) argument
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-24T13:46:26Z
Last change time
2019-10-28T11:58:35Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel
Comments
Comment #0 by moonlightsentinel — 2019-10-24T13:46:26Z
The following unittest from object.d fails to compile with -unittest -checkaction=context:
@safe unittest
{
// Bugzilla 14401
static class X
{
int a;
}
assert(typeid(X).initializer is typeid(X).m_init);
}
src/core/internal/dassert.d(110): Error: cannot implicitly convert expression `idup(s)` of type `immutable(void)[]` to `string`
src/core/internal/dassert.d(209): Error: template instance `core.internal.dassert.miniFormat!(const(void)[])` error instantiating
src/core/internal/dassert.d(17): instantiated from here: `miniFormatFakeAttributes!(const(void)[])`
src/object.d(1117): instantiated from here: `_d_assert_fail!("is", const(void)[], const(void)[])`
The is caused by miniFormat using string concenation when instantiated with const(void[] == typeof(typeid(X).initializer)).
Comment #1 by moonlightsentinel — 2019-10-24T13:47:21Z