Re: Factors that prevent implicit conversions to be found
martin odersky <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CAENVNkaqD2eGZ1DTgshpUELrQc6Soi+Mko0HBo1J7i0EvdDKDg@mail.gmail.com> |
Could it be a case of an implicit with a missing result type? - Martin On Thu, May 21, 2015 at 4:57 PM, Johannes Rudolph <[email protected]> wrote: > Hi, > > in the akka-http/spray routing DSL there's a case where an implicit > conversion isn't found in some cases (mostly deterministic per compile > run) for this line: > > parameter('color) > > where parameter's argument should be of type `ParamMagnet` and the > implicit conversion is defined in ParamMagnet's companion object. > > There's quite some logic involved behind the scenes to convert a > Symbol to a ParamMagnet implicit. The strange thing is that you can > make it compile by adding a line just mentioning the type > `ParamMagnet` above the problematic line: > > e.g. > > type X = akka.http.scaladsl.server.directives.ParameterDirectives.ParamMagnet > parameter('color) > > or > > val x: akka.http.scaladsl.server.directives.ParameterDirectives.ParamMagnet > = null > parameter('color) > > > Adding the line below the problematic one doesn't help. I know it's > not the first time I had such an issue but I cannot remember if I > found a solution or not before. > > `-Xlog-implicits` doesn't show anything. The compilation problem > occurs with Scala 2.10.x. > > Any ideas? > > Thanks, > Johannes > > -- > You received this message because you are subscribed to the Google Groups "scala-language" 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. -- Martin Odersky EPFL -- You received this message because you are subscribed to the Google Groups "scala-language" 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.