www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3346] New: classinfo behaves like no other D entity

reply d-bugmail puremagic.com writes:
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



12:23:47 PDT ---


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 26 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346




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: -------
Sep 26 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Max Samukha <samukha voliacable.com> changed:

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



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: -------
Sep 26 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Tomas Lindquist Olsen <tomas famolsen.dk> changed:

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



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: -------
Sep 27 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346




PDT ---
 work too then?
I think, yes. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 27 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346




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: -------
Sep 27 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346




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: -------
Sep 27 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Walter Bright <bugzilla digitalmars.com> changed:

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



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: -------
Nov 20 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3346


Walter Bright <bugzilla digitalmars.com> changed:

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



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: -------
Dec 06 2009