Thread overview
[Issue 15185] [REG2.069.0-b1] Not possible to create instance of TypeInfo
Oct 11, 2015
Jacob Carlborg
Oct 11, 2015
Kenji Hara
Oct 12, 2015
Martin Nowak
Oct 12, 2015
Jacob Carlborg
Oct 13, 2015
Jacob Carlborg
Oct 15, 2015
Martin Nowak
October 11, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

--- Comment #1 from Jacob Carlborg <doob@me.com> ---
I might add that "init" is declared as "abstract" so there's no compiler bug here.

--
October 11, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> ---
Introduced in: https://github.com/D-Programming-Language/druntime/pull/1307

--
October 12, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu

--- Comment #3 from Martin Nowak <code@dawg.eu> ---
Why do you need to instantiate TypeInfo?

--
October 12, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

--- Comment #4 from Jacob Carlborg <doob@me.com> ---
(In reply to Martin Nowak from comment #3)
> Why do you need to instantiate TypeInfo?

https://github.com/d-widget-toolkit/base/blob/master/src/java/nonstandard/RuntimeTraits.d#L13-L21

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #5 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Why not "typeid(const(Object))" and "(const(Object)).classinfo" ?

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

--- Comment #6 from Jacob Carlborg <doob@me.com> ---
(In reply to Steven Schveighoffer from comment #5)
> Why not "typeid(const(Object))" and "(const(Object)).classinfo" ?

The existing code will evaluate to "const(TypeInfo)". Your suggestion evaluates to "TypeInfo_Const". I guess I could hard code "const(TypeInfo)", but then I need put the whole alias declaration in a string mixin.

It's not like I don't know how work around the change. It broke my code so I reported an issue.

--
October 13, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

--- Comment #7 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Jacob Carlborg from comment #6)
> 
> The existing code will evaluate to "const(TypeInfo)". Your suggestion evaluates to "TypeInfo_Const". I guess I could hard code "const(TypeInfo)", but then I need put the whole alias declaration in a string mixin.

OK, I see now.

Honestly, I don't see this as a regression. TypeInfo was not meant to be instantiated by user code. The fact that it worked I don't think was intended, just an accident (The runtime obviously never instantiates a direct TypeInfo, it's always a subclass).

I recommend employing a workaround and closing this bug.

--
October 15, 2015
https://issues.dlang.org/show_bug.cgi?id=15185

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--