#198 √ resolved
Tom Mornini

[BUG] Need proper naming for anonymous classes

Reported by Tom Mornini | December 23rd, 2007 @ 11:06 PM | in 1.0 preview

sirb(eval):005> Class.new(StandardError)      
=> 

drbrain suggested "" instead

Comments and changes to this ticket

  • Eero Saynatkari

    Eero Saynatkari December 24th, 2007 @ 10:29 AM

    • → State changed from “new” to “open”

    I do not think this requires any special logic. An anonymous class' #inspect should be used and it can just be the default like for MRI:

    sirb> Class.new
    => #<Class: 0xp01nt3r>
    

    Or we could override it to be more descriptive. MRI uses the default unless the class has a name in which case that is used instead.

    X = Class.new returns @X@ in MRI. THAT part may require some special-casing of assignment, I am not certain.

  • Eero Saynatkari

    Eero Saynatkari January 11th, 2008 @ 10:31 AM

    • → Assigned user changed from “” to “Eero Saynatkari”
  • Brian Ford

    Brian Ford January 20th, 2008 @ 12:58 PM

    • → Title changed from “sirb display useless for nameless class” to “[BUG] Need proper naming for anonymous classes”
  • zimbatm

    zimbatm January 26th, 2008 @ 06:39 AM

    These cases work fine now.

    There are still some corner cases, but I don't know it they're worth being fixed :

    irb(main):001:0> Class.new(Class.new.new)
    TypeError: superclass must be a Class (#<Class:0xb7caa244> given)
    

    rubinius

    irb(main):001:0> Class.new(Class.new.new)
    TypeError: superclass must be a Class ( given)
    

    and

    irb(main):001:0> Class.new.new
    => #<#<Class:0xb7c37e88>:0xb7c37dac>
    

    rubinius

    irb(main):001:0> Class.new.new
    => #<:0x400a1>
    
  • zimbatm

    zimbatm January 26th, 2008 @ 07:03 AM

    • → State changed from “open” to “resolved”

    Pushed in b49c3b5...

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »