Re: Re: VerifyError ascribing java annotations to scala.annotation.Annotation

Daniel Armak <[email protected]> Wed, 3 Feb 2016 11:17:37 +0200
Newsgroups gmane.comp.lang.scala
Message-ID <CADtYB+nzQ7_7q8_DE-hnBSOdRF817Kvmm9uGoGi+Tk0BkdodXQ@mail.gmail.com>
It's mentioned in a comment on SI-9400, but not in the title or
description, and it's unrelated to subclassing a Java annotation, so the
ticket is hard to find. I'd create a new, more prominent ticket, but I
don't know what your policy is.

Thanks,

Daniel Armak

On Tue, Feb 2, 2016 at 3:31 PM, Lukas Rytz <[email protected]> wrote:

> This is another incarnation of
> https://issues.scala-lang.org/browse/SI-9400
> see also the discussion on https://github.com/scala/scala/pull/4638.
>
>
> On Monday, February 1, 2016 at 8:10:41 PM UTC+1, Daniel Armak wrote:
>>
>> Even weirder:
>>
>> scala> val x: Deprecated = null
>> x: Deprecated = null
>>
>> scala> x: StaticAnnotation
>> res14: scala.annotation.StaticAnnotation = null
>>
>> scala> (x: StaticAnnotation): Annotation
>> res15: scala.annotation.Annotation = null
>>
>> scala> x: Annotation
>> java.lang.VerifyError: Bad type on operand stack
>>
>> ​
>> --
>> Daniel Armak
>>
>> On Mon, Feb 1, 2016 at 8:50 PM, Daniel Armak <[email protected]> wrote:
>>
>>> scala> import scala.reflect.runtime.universe.typeOf
>>> scala> import scala.annotation.Annotation
>>> scala> import java.lang.Deprecated
>>> ​
>>> scala> typeOf[Deprecated] <:< typeOf[Annotation]
>>> res0: Boolean = true
>>> ​
>>> scala> val x: Deprecated = null
>>> x: Deprecated = null
>>> ​
>>> scala> x: Annotation
>>> java.lang.VerifyError: Bad type on operand stack
>>>
>>> The same happens with any Java annotation, Deprecated isn’t special.
>>>
>>> What is the intention? Why should Java annotations subtype
>>> scala.annotation.Annotation?
>>>
>>> This is mentioned in a comment in SI-9400, but that’s about a different
>>> issue and I think if this is a bug it deserves its own ticket.
>>> ​
>>> --
>>> Daniel Armak
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "scala-language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.