Bug 12233 – Attempting to use TypeInfo.init results in a compiler error due to lack of 'this'.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-23T03:08:51Z
Last change time
2018-01-05T13:27:04Z
Keywords
pull
Assigned to
ag0aep6g
Creator
Kapps
Depends on
7066
See also
https://issues.dlang.org/show_bug.cgi?id=7066

Comments

Comment #0 by opantm2+dbugs — 2014-02-23T03:08:51Z
It tries to use the init() method on TypeInfo, which fails because init() is not static. Particularly annoying in generic code, which is where .init is meant to be used in the first place... Sample: import std.stdio; void main() { writeln(TypeInfo.init); }
Comment #1 by initrd.gz — 2015-09-21T22:04:48Z
Just ran into this with `CommonType!(TypeInfo, TypeInfo)` returning `const(void)[]`.
Comment #2 by schveiguy — 2015-09-22T12:54:35Z
I think it's worth putting the init function on the deprecation cycle. I'll look into it. What I don't know is if it is affected by the compiler or just druntime.
Comment #3 by ag0aep6g — 2015-10-08T05:19:06Z
*** Issue 15037 has been marked as a duplicate of this issue. ***
Comment #4 by ag0aep6g — 2015-10-08T05:20:17Z
Comment #5 by github-bugzilla — 2015-12-29T21:16:03Z
Commit pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/04700217971964fdc8edb1798eaa669ec37fa7e9 rename TypeInfo's init method to initializer "init" clashes with the type property of the same name. Adding an alias called "init" to give people a chance to update their code. Further deprecation plan: * 2.071: Do nothing. Keep both init and initializer functional for a while. * 2.072: Deprecate the alias. * 2.073: Replace the alias with an `@disable`d method. * 2.074: Remove the init method, fixing issue 12233.
Comment #6 by github-bugzilla — 2016-01-03T14:10:14Z
Comment #7 by github-bugzilla — 2017-04-10T22:15:24Z
Commit pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/dc7d312b7f22835d8211c0f680fab1088a839324 remove TypeInfo.init Fixes issue 12233 - Attempting to use TypeInfo.init results in a compiler error due to lack of 'this'.
Comment #8 by github-bugzilla — 2017-06-17T11:34:26Z
Comment #9 by github-bugzilla — 2017-08-07T12:25:51Z
Comment #10 by github-bugzilla — 2018-01-05T13:27:04Z