Giter VIP home page Giter VIP logo

Comments (6)

felixblaschke avatar felixblaschke commented on July 25, 2024 1

I used the past time to re-read everything about generics in dart and experimented a bit. Now I have a better understanding on what's going on.

I learned that this. is obiviously unnecessary and causes problems (dart loses generics type information when using this).

I made some changes 700ea4a
Can you verify that it's the way to go?

from supercharged.

felixblaschke avatar felixblaschke commented on July 25, 2024

Thank you for the information. I will look into that topic and try to fix all code while having implicit-casts: false

from supercharged.

felixblaschke avatar felixblaschke commented on July 25, 2024

I fixed all analytic errors that happend when having implicit-casts: false. Changes are pushed to master branch. Do you have the opportunity to verify it?

from supercharged.

kuhnroyal avatar kuhnroyal commented on July 25, 2024

I am afraid this does not solve the problem and I may not have explained it correctly.
I also don't think the changes in 74ff727 are needed.

The problem may only occur with the List<T> to Map<K, V> extensions groupBy and associate*.

Your extension Iterable_<T, K, V> declares 3 generics types but only one is known from the source iterable (T). K and V are actually unknown, and if those can not be inferred the compiler will just cast it (with implicit-casts: true).

Of course one can always cast the results of groupBy for example but instead the function should have the K and V generic type arguments to help the compiler infer the resulting type groupBy<K, V>.

from supercharged.

kuhnroyal avatar kuhnroyal commented on July 25, 2024

This looks good, thanks!

Now we just need a way of calling extensions function on null receivers in Dart for more Kotlin magic. :)

from supercharged.

felixblaschke avatar felixblaschke commented on July 25, 2024

Great! Thank you for your help :-)

from supercharged.

Related Issues (19)

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.