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

ClassfileAnnotation: confusing error when argument is implicitly converted

    Details

      Description

      classfile annot arg, confusing error message when implicitly converted argument. says "need constant, found X" where X is a constant

      object conv {
        implicit def i2s(i: Int): String = ""
      }
      import conv._
      class annot(value: String) extends annotation.ClassfileAnnotation
      @annot(101) class C
      

      gives

      t5892.scala:6: error: annotation argument needs to be a constant; found: 101
      @annot(101) class C
             ^
      

        Activity

        Hide
        Paul Phillips added a comment -

        76bb23df5e2 in master, will look at 2.10.x

        Show
        Paul Phillips added a comment - 76bb23df5e2 in master, will look at 2.10.x
        Hide
        Paul Phillips added a comment -

        Looks like 2.11 has the exclusive.

        Show
        Paul Phillips added a comment - Looks like 2.11 has the exclusive.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Lukas Rytz
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development