sirthias / parboiled2

A macro-based PEG parser generator for Scala 2.10+
Other
717 stars 86 forks source link

understanding shapeless errors #177

Closed Vadi closed 7 years ago

Vadi commented 7 years ago

Can't how to read this error message, any help is greatly appreciated –

Is there possibility to be more specific with error messages?

PS: Haven't read shapeless yet!

Error:(23, 107) overloaded method value apply with alternatives:
  [G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[G,shapeless.::[H,shapeless.::[I,shapeless.::[J,shapeless.::[K,shapeless.::[L,shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[H,shapeless.::[I,shapeless.::[J,shapeless.::[K,shapeless.::[L,shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[I,shapeless.::[J,shapeless.::[K,shapeless.::[L,shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[J,shapeless.::[K,shapeless.::[L,shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[K,shapeless.::[L,shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[L,shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[M,shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[N,shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(N, O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[O,shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(O, P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[P,shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(P, Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [Q, R, S, T, U, V, W, X, Y, Z, RR](f: (Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[Q,shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(Q, R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [R, S, T, U, V, W, X, Y, Z, RR](f: (R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[R,shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(R, S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [S, T, U, V, W, X, Y, Z, RR](f: (S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[S,shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(S, T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [T, U, V, W, X, Y, Z, RR](f: (T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[T,shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(T, U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [U, V, W, X, Y, Z, RR](f: (U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[U,shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(U, V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [V, W, X, Y, Z, RR](f: (V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[V,shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(V, W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [W, X, Y, Z, RR](f: (W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[W,shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(W, X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [X, Y, Z, RR](f: (X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[X,shapeless.::[Y,shapeless.::[Z,shapeless.HNil]]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(X, Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [Y, Z, RR](f: (Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[Y,shapeless.::[Z,shapeless.HNil]],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(Y, Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [Z, RR](f: (Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[Z,shapeless.HNil],shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(Z, String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [RR](f: (String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.HNil,shapeless.HNil,RR], implicit c: org.parboiled2.support.FCapture[(String, scala.collection.immutable.Seq[io.copper.tryouts.HValue]) => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [RR](f: scala.collection.immutable.Seq[io.copper.tryouts.HValue] => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.HNil,shapeless.::[String,shapeless.HNil],RR], implicit c: org.parboiled2.support.FCapture[scala.collection.immutable.Seq[io.copper.tryouts.HValue] => RR])org.parboiled2.Rule[j.In,j.Out] <and>
  [RR](f: () => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.HNil,shapeless.::[String,shapeless.::[scala.collection.immutable.Seq[io.copper.tryouts.HValue],shapeless.HNil]],RR], implicit c: org.parboiled2.support.FCapture[() => RR])org.parboiled2.Rule[j.In,j.Out]
 cannot be applied to ((String, scala.collection.Seq[io.copper.tryouts.HObject]) => io.copper.tryouts.HObject)
    WhiteSpace ~ Key ~ Seperators ~ oneOrMore(BlockUnwrapped).separatedBy(optional(ws(','))) ~ WhiteSpace ~> { (k: String, f: Seq[HObject]) ⇒
sirthias commented 7 years ago

Yeah, unfortunately these error messages aren't the greatest in conveying the problem. Still, if you look carefully you can spot the roots of the problem.

Your action expects a String and a Seq[HObject] on the top of the value stack. However, your BlockUnwrapped rule appears to produce an HValue.

What happens, if you leave away the type asciption on the f parameter of your action function? What if you change it to Seq[HValue] instead?

And: please use the mailing list for questions like these, rather than opening tickets.

Vadi commented 7 years ago

Thanks @sirthias for the help. I will use mailing list.