From 5ac69667c0ae93c57c276cf9487f13ffad2505e6 Mon Sep 17 00:00:00 2001 From: anonymous Date: Mon, 10 Apr 2017 16:41:10 +0200 Subject: [PATCH 1/2] clear changelog --- changelog/disable-TypeInfo.init.dd | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 changelog/disable-TypeInfo.init.dd diff --git a/changelog/disable-TypeInfo.init.dd b/changelog/disable-TypeInfo.init.dd deleted file mode 100644 index 824635eae3..0000000000 --- a/changelog/disable-TypeInfo.init.dd +++ /dev/null @@ -1,12 +0,0 @@ -`TypeInfo.init` has been `@disable`d. - -$(REF_OBJECT_SHORT TypeInfo.init) has been `@disable`d. Use -$(REF_OBJECT_SHORT TypeInfo.initializer) instead. - -`TypeInfo.init` is a legacy alias of the method that is now called -$(REF_OBJECT_SHORT TypeInfo.initializer). The name change is necessary because -the name "init" clashes with the type property of the same name -($(GLINK2 property, init)). - -The legacy alias has been deprecated since 2.072.0. It's going to be removed in -2.075.0. From dc7d312b7f22835d8211c0f680fab1088a839324 Mon Sep 17 00:00:00 2001 From: anonymous Date: Mon, 10 Apr 2017 16:54:04 +0200 Subject: [PATCH 2/2] remove TypeInfo.init Fixes issue 12233 - Attempting to use TypeInfo.init results in a compiler error due to lack of 'this'. --- changelog/remove-TypeInfo.init.dd | 6 ++++++ src/object.d | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 changelog/remove-TypeInfo.init.dd diff --git a/changelog/remove-TypeInfo.init.dd b/changelog/remove-TypeInfo.init.dd new file mode 100644 index 0000000000..9118335f01 --- /dev/null +++ b/changelog/remove-TypeInfo.init.dd @@ -0,0 +1,6 @@ +`TypeInfo.init` now refers to type property. + +`TypeInfo.init` used to refer to the method that is now called +$(REF_OBJECT_SHORT TypeInfo.initializer). The name change was necessary because +the name "init" would clash with the type property of the same name +($(GLINK2 property, init)). `TypeInfo.init` now refers to the type property. diff --git a/src/object.d b/src/object.d index ba00985e1e..7a16247246 100644 --- a/src/object.d +++ b/src/object.d @@ -285,11 +285,6 @@ class TypeInfo */ abstract const(void)[] initializer() nothrow pure const @safe @nogc; - /// $(RED Removed.) Please use `initializer` instead. - @disable static const(void)[] init(); // since 2.074 - /* Planned for 2.075: Remove init, making way for the init type property, - fixing issue 12233. */ - /** Get flags for type: 1 means GC should scan for pointers, 2 means arg of this type is passed in XMM register */ @property uint flags() nothrow pure const @safe @nogc { return 0; } @@ -360,6 +355,12 @@ class TypeInfo_Typedef : TypeInfo void[] m_init; } +unittest // issue 12233 +{ + static assert(is(typeof(TypeInfo.init) == TypeInfo)); + assert(TypeInfo.init is null); +} + class TypeInfo_Enum : TypeInfo_Typedef {