Thanks for forwarding. Josh posted an example on
https://github.com/jmgao/si-8788
that shows what currently works.

I think that the current special support for Parcelable is the wrong
approach, and we
should deprecate it and not invest time in fixing bugs.

Instead, we should revive the @static annotation,
https://issues.scala-lang.org/browse/SI-4581. It was once implemented
<https://github.com/scala/scala/pull/894>, but later reverted
<https://github.com/scala/scala/pull/1340>. As Greg noted, this should come
with a SIP.

On Wed, Sep 17, 2014 at 12:45 AM, Nick Stanchenko <[email protected]>
wrote:

> Hi,
>
> I think you’d have better luck cc/ing this to the entire scala-on-android
> mailing list (done!), rather than a single person.
>
> Nick
>
>
> On Tuesday, September 16, 2014 9:57:00 PM UTC+1, Lukas Rytz wrote:
>>
>> cc / Josh Gao (submitted the PR
>> <https://github.com/scala/scala/pull/3964>), Sung-Ho Lee (scaloid
>> <https://github.com/pocorall/scaloid> maintainer)
>>
>>
>> Hi,
>>
>> I'm looking into the Scala compiler's support for adding a static
>> "CREATOR" field to classes extending Parcelable
>> <http://developer.android.com/reference/android/os/Parcelable.html>.
>>
>> I have doubts that what the Scala compiler does is working in any way -
>> or can you show me any working examples?
>>
>>
>> For example, if I write:
>>
>> class C extends android.os.Parcelable {
>>   def foo = 0
>> }
>>
>> Then the Scala compiler (2.11.2) produces (pseudo-syntax):
>>
>> class C extends android.os.Parcelable {
>>   static final Parcelable$Creator CREATOR = C$.MODULE$.CREATOR()
>>   // - the initializer expression is added to the static class
>> initializer of C
>>   // - the intialization does an "invokevirtual" of a method called
>> "CREATOR" - I haven't found such a method anywhere (Android API?)
>>   //   Is it expected to be provided by the user? Then the compiler
>> should warn if it's not there!
>>   // - no class file named C$ is emitted - class loading fails with
>> "ClassNotFoundException: C$"
>> }
>>
>>
>> I'd be glad if somebody can shed some light on this. I found some more
>> bugs in there.
>>
>> Thanks!
>> Lukas
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "scala-internals" 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-on-android" 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.

Reply via email to