www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 373] New: Spec problems with TypeInfo: error and omission.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=373

           Summary: Spec problems with TypeInfo: error and omission.
           Product: D
           Version: 0.167
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: spec
          Severity: major
          Priority: P1
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: brunodomedeiros+bugz gmail.com


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.)


-- 
Sep 26 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=373


bugzilla digitalmars.com changed:

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





Fixed DMD 0.175


-- 
Nov 25 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=373






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?


-- 
Nov 28 2006