Scala Programming Language
  1. Scala Programming Language
  2. SI-6277

some methods of Symbol don't work correctly unless the symbol is initialized

    Details

      Description

      It seems isSealed is not working at runtime. At least, it doesn't work for List:

      
      Welcome to Scala version 2.11.0-20120808-025516-c0d5f0aadd (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
      Type in expressions to have them evaluated.
      Type :help for more information.
      
      scala> import reflect.runtime.universe._
      import reflect.runtime.universe._
      
      scala> typeOf[List]
      <console>:11: error: type List takes type parameters
                    typeOf[List]
                           ^
      
      scala> typeOf[List[_]]
      res1: reflect.runtime.universe.Type = scala.List[_]
      
      scala> res1.type
      typeConstructor   typeSymbol        
      
      scala> res1.typeSymbol
      res2: reflect.runtime.universe.Symbol = class List
      
      scala> res2.asClass
      res3: reflect.runtime.universe.ClassSymbol = class List
      
      scala> res3.isSealed
      res4: Boolean = false
      

      upd. This also plagues annotation-getting methods as described in SI-6428. In the interest of full disclosure, I should mention that privateWithin is also affected.

        Activity

        Hide
        Eugene Burmako added a comment -

        Sure, I will submit a pull request within a week.

        Show
        Eugene Burmako added a comment - Sure, I will submit a pull request within a week.
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/1264
        Hide
        Josh Suereth added a comment -

        pull request was dropped.

        Show
        Josh Suereth added a comment - pull request was dropped.
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/1380
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/commit/2fb507b849e2b0f86c2480bde95200f8ae30803d

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Daniel Sobral
          • Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development