Factors that prevent implicit conversions to be found
Johannes Rudolph <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CAKF7HnfbiVXanhkJr+z3i-kMB9S_mu+QqZX1O5tbUhasZ+00HA@mail.gmail.com> |
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.