Giter Site home page Giter Site logo

Comments (8)

frankiesardo avatar frankiesardo commented on July 23, 2024

ArrayList double cast is necessary to force type erasure #25

You're right, Parcelable cast is not needed, but it is part of the same typecast family and keeping it out is more a cognitive load than including it. Runtime penalty is basically non-existent.

If there are more pressing reasons to remove it I'm happy to give it a second though.

from icepick.

MikolajKakol avatar MikolajKakol commented on July 23, 2024

Thanks for looking into it. Although you probably right about second part of my question, you haven't written what you think about generics support.

Let's say I have base ProductActivity class that is responsible to display Product. Now many classes inherits from Product so I want to declare my Activity as ProductActivity<T extends Product> and have protected T product variable that would be persisted using @Icepick. Having this situation Icepick would generate code like

target.product= (T) savedInstanceState.getParcelable(BASE_KEY + "product");

The T type is unknown so this code won't compile. This cast is unnecessary, it might be impossible to have type mismatch here.

from icepick.

frankiesardo avatar frankiesardo commented on July 23, 2024

You're right, that is actually a bug. I think the typecast should be smarter, otherwise simply removing "Parcelable" from the typecast list won't solve the issue. I'll keep this thread open

from icepick.

IlyaEremin avatar IlyaEremin commented on July 23, 2024

Any progress here?

from icepick.

frankiesardo avatar frankiesardo commented on July 23, 2024

Yes, there is a new version ready to be published soon. Would you like to
try a snapshot version?
On 12 Feb 2015 10:44, "Ilya Eremin" [email protected] wrote:

Any progress here?


Reply to this email directly or view it on GitHub
#35 (comment).

from icepick.

IlyaEremin avatar IlyaEremin commented on July 23, 2024

Yeap, I would be happy if you would upload snapshot.

from icepick.

frankiesardo avatar frankiesardo commented on July 23, 2024

This is the release candidate:

dependencies {
  compile "frankiesardo:icepick:3.0.0-SNAPSHOT"
  provided "frankiesardo:icepick-processor:3.0.0-SNAPSHOT"
}
repositories {
    mavenCentral()
    maven {
      url "https://clojars.org/repo/"
    }
}

from icepick.

frankiesardo avatar frankiesardo commented on July 23, 2024

Fixed with 460e7c8

from icepick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.