Thread overview
[Issue 3346] New: classinfo behaves like no other D entity
Sep 26, 2009
Max Samukha
Sep 27, 2009
Max Samukha
Sep 27, 2009
Max Samukha
Nov 21, 2009
Walter Bright
Dec 06, 2009
Walter Bright
September 26, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346

           Summary: classinfo behaves like no other D entity
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrei@metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei@metalanguage.com> 2009-09-26 12:23:47 PDT ---


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 26, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346



--- Comment #1 from Andrei Alexandrescu <andrei@metalanguage.com> 2009-09-26 12:24:59 PDT ---
This code does not compile:

class A {
    void fun() {
        auto ci = classinfo;
    }
}

But this does:

class A {
    void fun() {
        auto ci = this.classinfo;
    }
}

And this does too:

class A {
    void fun() {
        auto ci = A.classinfo;
    }
}

No other entity in D has these weird lookup rules.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 26, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Max Samukha <samukha@voliacable.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samukha@voliacable.com


--- Comment #2 from Max Samukha <samukha@voliacable.com> 2009-09-26 14:55:29 PDT ---
Also, 'outer':

class Outer
{
    class Inner
    {
        this()
        {
            auto a = this.outer; //compiles
            auto b = outer; //doesn't
        }
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Tomas Lindquist Olsen <tomas@famolsen.dk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomas@famolsen.dk


--- Comment #3 from Tomas Lindquist Olsen <tomas@famolsen.dk> 2009-09-27 05:10:26 PDT ---
Should:

struct S
{
  size_t foo()
  {
    return sizeof;
  }
}

work too then?

As I see it .classinfo is a built in *property*, it's not a member!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346



--- Comment #4 from Max Samukha <samukha@voliacable.com> 2009-09-27 05:56:16 PDT ---
> work too then?

I think, yes.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346



--- Comment #5 from Andrei Alexandrescu <andrei@metalanguage.com> 2009-09-27 06:04:26 PDT ---
One additional thing about classinfo is that it is at the same time a static and a nonstatic property.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346



--- Comment #6 from Max Samukha <samukha@voliacable.com> 2009-09-27 08:48:56 PDT ---
Really. That explains why we cannot use 'classinfo' alone.

I think there should be 'classInfo' and 'staticClassInfo' (Qt's analogues are 'metaObject' and 'staticMetaObject'). Then no need to fix bug 3345. Also, we could avoid some extra pain when introspecting identically named methods.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #7 from Walter Bright <bugzilla@digitalmars.com> 2009-11-20 17:59:16 PST ---
With the changes to typeid(), perhaps we can simply deprecate .classinfo

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 06, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #8 from Walter Bright <bugzilla@digitalmars.com> 2009-12-06 01:18:22 PST ---
exp.classinfo is deprecated now, use typeid(exp) instead. TypeInfo replaces
ClassInfo.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------