precog / matryoshka

Generalized recursion schemes and traversals for Scala.
Apache License 2.0
811 stars 87 forks source link

Add scala-clippy advice #54

Open sellout opened 7 years ago

sellout commented 7 years ago

Matryoshka could definitely benefit from library-specific advice when it comes to compiler errors. See here for how: https://github.com/softwaremill/scala-clippy#library-specific-advice

ShaneDelmore commented 7 years ago

I'll take this one. Been looking for a library to contribute advice to since I added the feature to clippy. If anyone has common gotchas that could benefit from advice sent in response to a compiler error add them here and I will add the advice and tests. Missing imports are a common area that can benefit.

sellout commented 7 years ago

@smungee received the following error: “matryoshka.Recursive.Ops[matryoshka.data.Fix[$file.ExprTest.Expr],$file.ExprTest.Expr]#transAna.type does not take parameters” and the explanation I’d like to see is something like “transAna requires a type parameter specifying the result type. In this case, it may be transAna[Fix[Expr]],” (where both “transAna” and “Fix[Expr]” are extracted from the error message (if possible)).