This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: getClass returns Class[_]?

No replies
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.

>>>>> "Andreou" == Andreou Dimitris writes:

Andreou> Hi, Probably this is a complicated issue, but shouldn't the
Andreou> following work?

Andreou> val xClass: Class[X] = new X().getClass //it returns Class[_],
Andreou> nor Class[X]

Andreou> val integerClass: Class[Integer] = new Integer(5).getClass
Andreou> //similar error

There's been a ticket open on this for a long time in Trac:

http://lampsvn.epfl.ch/trac/scala/ticket/490

I really hope it gets fixed in 2.8.0.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland