Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes defined in REPL have no ScalaSig annotation #4567

Closed
scabug opened this issue May 11, 2011 · 4 comments
Closed

Classes defined in REPL have no ScalaSig annotation #4567

scabug opened this issue May 11, 2011 · 4 comments

Comments

@scabug
Copy link

scabug commented May 11, 2011

Classes defined in the REPL are missing ScalaSig annotation.

=== What steps will reproduce the problem? ===

In 2.8.1 REPL:

    Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit
Server VM, Java 1.6.0_24).

    scala> case class Foo(x: String)
    defined class Foo

    scala> val clazz = classOf[Foo]
    clazz: java.lang.Class[Foo] = class Foo

    scala> clazz.getAnnotations
    res1: Array[java.lang.annotation.Annotation] = Array() 

In 2.9.0.RC4 REPL:

    Welcome to Scala version 2.9.0.RC4 (Java HotSpot(TM) 64-Bit Server
VM, Java 1.6.0_24).

    scala> case class Foo(x: String)
    defined class Foo

    scala> val clazz = classOf[Foo]
    clazz: java.lang.Class[Foo] = class Foo

    scala> clazz.getAnnotations
    res0: Array[java.lang.annotation.Annotation] = Array() 

=== What is the expected behavior? ===
Compare with this example, running sbt console in the Salat project
looking at one of the Salat test model classes, which has of course
a .class file but also a ScalaSig annotation:

    scala> import com.novus.salat.test.model._
    import com.novus.salat.test.model._

    scala> val clazz = classOf[Hector]
    x: java.lang.Class[com.novus.salat.test.model.Hector] = class
com.novus.salat.test.model.Hector

    scala> clazz.getAnnotations
    res2: Array[java.lang.annotation.Annotation] =
    !A/Z:u s9 "A tC2,GN   calaSignature(bytes=   c C                Q
                    GO  
    // etc etc etc 

=== What do you see instead? ===

I expect that defining a class in the REPL should create a class with a ScalaSig annotation.

Failing that, extending ScalaSigParser to be able to manually derive a ScalaSig annotation on a class defined in the REPL (or anywhere) would be extremely useful.

=== Additional information ===
http://groups.google.com/group/scala-user/browse_thread/thread/484ed3e719f13fdf

=== What versions of the following are you using? ===

  • Scala: 2.8.1
  • Java: 1.6.0_24-b07
  • Operating system: Ubuntu 11.04 64-bit
@scabug
Copy link
Author

scabug commented May 11, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4567?orig=1
Reporter: Rose Toomey (rktoomey)

@scabug
Copy link
Author

scabug commented May 11, 2011

@paulp said:
Based on iulian's input on the mailing list I am reclassifying as enhancement, since the signature is not missing. But it is not ideally located.

@scabug
Copy link
Author

scabug commented May 11, 2011

Rose Toomey (rktoomey) said:
Here is a gist showing my defined class vs the ScalaSig of its containing object:
https://gist.github.com/966803

@SethTisue
Copy link
Member

stale ticket, and not really a bug per se. could be revived on https://contributors.scala-lang.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants