Bug 373 – Spec problems with TypeInfo: error and omission.
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dlang.org
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-09-26T11:57:00Z
Last change time
2014-02-15T13:28:54Z
Keywords
spec
Assigned to
bugzilla
Creator
bruno.do.medeiros+deebugz
Comments
Comment #0 by bruno.do.medeiros+deebugz — 2006-09-26T11:57:02Z
In Functions (http://www.digitalmars.com/d/function.html), Variadic Functions With Type Info, there is an example of a variadic function, but there is an error in the FOO clause:
else if (_arguments[i] == typeid(FOO))
{
FOO f = *cast(FOO*)_argptr;
...
This if clause will match not only FOO (should be called 'Foo' for style consistency, btw), but any kind of class and interface, since apparently TypeInfo's equality('==') operator tests for equality of "archetype", and all classes and even interfaces are all part of the same archetype (class).
Additionally, this TypeInfo comparison behavior was all inferred empirically: there is nowhere (AFAIK) in the spec that explains how TypeInfo's are to be compared, and consequently what are the effects of 'is' and '==' comparisons. (Please fix this as well.)
Comment #1 by bugzilla — 2006-11-25T03:50:44Z
Fixed DMD 0.175
Comment #2 by bruno.do.medeiros+deebugz — 2006-11-28T06:22:56Z
The only doc change I see is the FOO->Foo consistency change, which is not what this bug is about. Did you forget to roll more doc updates or was that just it?