Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 1f292ca

Browse files
authored
Merge pull request #1807 from aG0aep6G/remove-TypeInfo.init
Remove TypeInfo.init merged-on-behalf-of: Steven Schveighoffer <schveiguy@users.noreply.github.com>
2 parents 5d5645c + dc7d312 commit 1f292ca

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

changelog/disable-TypeInfo.init.dd

Lines changed: 0 additions & 12 deletions
This file was deleted.

changelog/remove-TypeInfo.init.dd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
`TypeInfo.init` now refers to type property.
2+
3+
`TypeInfo.init` used to refer to the method that is now called
4+
$(REF_OBJECT_SHORT TypeInfo.initializer). The name change was necessary because
5+
the name "init" would clash with the type property of the same name
6+
($(GLINK2 property, init)). `TypeInfo.init` now refers to the type property.

src/object.d

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,6 @@ class TypeInfo
285285
*/
286286
abstract const(void)[] initializer() nothrow pure const @safe @nogc;
287287

288-
/// $(RED Removed.) Please use `initializer` instead.
289-
@disable static const(void)[] init(); // since 2.074
290-
/* Planned for 2.075: Remove init, making way for the init type property,
291-
fixing issue 12233. */
292-
293288
/** Get flags for type: 1 means GC should scan for pointers,
294289
2 means arg of this type is passed in XMM register */
295290
@property uint flags() nothrow pure const @safe @nogc { return 0; }
@@ -360,6 +355,12 @@ class TypeInfo_Typedef : TypeInfo
360355
void[] m_init;
361356
}
362357

358+
unittest // issue 12233
359+
{
360+
static assert(is(typeof(TypeInfo.init) == TypeInfo));
361+
assert(TypeInfo.init is null);
362+
}
363+
363364
class TypeInfo_Enum : TypeInfo_Typedef
364365
{
365366

0 commit comments

Comments
 (0)