6 ms·
Do you have some examples for "type inference fails"? Do you have some examples for "compiler bug"?
by premium-concern 10y ago
Do you have some examples for "type inference fails"?
Do you have some examples for "compiler bug"?
- harveywi 10y agoHere is a quick shortlist of some type inference issues (some bugs, some enhancements, and some fundamental limitations of the language design) that I run into pretty much daily: 1. (Search for "asInstanceOf"): http://typelevel.org/cats/tut/freemonad.html http://typelevel.org/cats/tut/freemonad.html 2. (Finally fixed and will hopefully be released soon - yay!): https://issues.scala-lang.org/browse/SI-2712 https://issues.scala-lang.org/browse/SI-2712 3. https://twitter.com/extempore2/status/430456002392391681 https://twitter.com/extempore2/status/430456002392391681 4. http://pchiusano.blogspot.com/2011/05/making-most-of-scalas-extremely-limited.html http://pchiusano.blogspot.com/2011/05/making-most-of-scalas-... 5. (Anecdotal): Various pattern matching peculiarities. Compiler bugs: As long as I write code on the happy path and steer clear of scalaz/shapeless/cats, the compiler is pretty well-behaved and I can go months without getting a compiler crash. However, when I add those in and start writing pure functional code with complicated types that hits the intersections of various features (e.g., GADTs, package objects, implicits), I get a few crashes per week related to known bugs. It works pretty well, and I am not trying to complain too much about all the mileage I get out of Scala and the excellent tooling! Just trying to get the most out of it.
- premium-concern 10y ago> I get a few crashes per week related to known bugs Interesting! Can you link to the issue?
- harveywi 10y agoSure, you bet - I will start collecting them as they occur. However, I no longer find new bugs, it seems. I'll break something, google for the error message, and either find something on issues.scala-lang.org, IRC, or one of the Google Groups. My current code base is not open-source just yet, so reporting self-contained reports may not be possible. (Currently I'm writing an interpreter for a fairly big declarative language using FreeApplicative from cats as the substrate, and I think the sheer size of it along with shapeless and scalaz usage is causing some undesirable feature interactions. Where would be the best venue for reporting (known) bugs? Is there any value if I can't provide the actual code? Or is just reporting a "I experienced it too" message valuable?
- premium-concern 10y agoI think this would help a lot. It would also help to check whether the code mentioned in an issue that triggers a crash is equivalent to the code you have. Even if you can't publish your code, it might help to say "I'm seeing the same error, but I'm using X unlike the exmaple code that uses Y". This will make sure that people who fix a bug will cover both causes with a test.
- harveywi 10y agoHere is a new one that I reported to scala-internals today: https://groups.google.com/forum/#!topic/scala-internals/w4HGp4_QQwk https://groups.google.com/forum/#!topic/scala-internals/w4HG...
- premium-concern 10y agoGreat, thanks!
- harveywi 10y agoI hit two bugs today. Both were produced during major global refactoring. I did not have time to catalogue the reproduction steps or anything, so I have no right to complain! 1. https://issues.scala-lang.org/browse/SI-9281 https://issues.scala-lang.org/browse/SI-9281 2. https://issues.scala-lang.org/browse/SI-8322 https://issues.scala-lang.org/browse/SI-8322
- harveywi 10y agoAnd another one today: https://issues.scala-lang.org/browse/SI-9222 https://issues.scala-lang.org/browse/SI-9222
- premium-concern 10y agoThanks! What the hell are you doing that you experience issues this often? :-)