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

AnnotationDefault

1 reply
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

After recent repl completion patch, hitting tab while things are still
spinning up I see this:

scala>

classOf AnnotationDefault apple asInstanceOf
ch com isInstanceOf java
javax jline org quicktime
scala sun sunw toString
actors annotation collection compat
concurrent dbc io math
mobile ref reflect runtime
swing testing text tools
util xml instrument management

Sure enough, "AnnotationDefault" is in the root class:

lazy val AnnotationDefaultAttr: Symbol = {
val attr = newClass(RootClass, nme.AnnotationDefaultATTR, List(AnnotationClass.typeConstructor))
// This attribute needs a constructor so that modifiers in parsed Java code make sense
attr.info.decls enter (attr newConstructor NoPosition setInfo MethodType(Nil, attr.tpe))
attr
}

Any chance it could go somewhere less fundamental? Doesn't exactly fit
in with its neighbors:

scala> global.definitions.RootClass.tpe.nonPrivateMembers foreach println
class AnnotationDefault
package _root_
package
package ch
package scala
package jline
package quicktime
package apple
package com
package javax
package sun
package sunw
package java
package org

rytz
Joined: 2008-07-01,
User offline. Last seen 45 weeks 5 days ago.
Re: AnnotationDefault
agreed in r21680 :)

On Mon, Apr 26, 2010 at 07:49, Paul Phillips <paulp@improving.org> wrote:
After recent repl completion patch, hitting tab while things are still
spinning up I see this:

scala>

classOf             AnnotationDefault   apple               asInstanceOf
ch                  com                 isInstanceOf        java
javax               jline               org                 quicktime
scala               sun                 sunw                toString
actors              annotation          collection          compat
concurrent          dbc                 io                  math
mobile              ref                 reflect             runtime
swing               testing             text                tools
util                xml                 instrument          management

Sure enough, "AnnotationDefault" is in the root class:

   lazy val AnnotationDefaultAttr: Symbol = {
     val attr = newClass(RootClass, nme.AnnotationDefaultATTR, List(AnnotationClass.typeConstructor))
     // This attribute needs a constructor so that modifiers in parsed Java code make sense
     attr.info.decls enter (attr newConstructor NoPosition setInfo MethodType(Nil, attr.tpe))
     attr
   }

Any chance it could go somewhere less fundamental? Doesn't exactly fit
in with its neighbors:

scala> global.definitions.RootClass.tpe.nonPrivateMembers foreach println
class AnnotationDefault
package _root_
package <empty>
package ch
package scala
package jline
package quicktime
package apple
package com
package javax
package sun
package sunw
package java
package org

--
Paul Phillips      | Adultery is the application of democracy to love.
Caged Spirit       |     -- H. L. Mencken
Empiricist         |
i'll ship a pulp   |----------* http://www.improving.org/paulp/ *----------

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