Skip to content

Instantly share code, notes, and snippets.

@olafurpg
Created February 21, 2016 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olafurpg/5c4055932ee2e3403275 to your computer and use it in GitHub Desktop.
Save olafurpg/5c4055932ee2e3403275 to your computer and use it in GitHub Desktop.
ollie-scalameta@ """case x: (Int, Int) => 1""".parse[Case]
scala.meta.parsers.common.ParseException: identifier expected but integer literal found at 22..23
ollie-scalameta@ """def macroTransform(annottees: Any*) = macro Cached.cachedImpl""".parse[Stat]
scala.meta.parsers.common.ParseException: macros must have explicitly specified return types at 4..18
ollie-scalameta@ """for { ident @ (__ : Int) <- List(1, 2) } yield ident + 1""".parse[Stat]
scala.meta.parsers.common.ParseException: ) expected but : found at 18..19
ollie-scalameta@ """import Predef.{ any2stringadd => _, _ => _ }""".parse[Stat]
scala.meta.parsers.common.ParseException: } expected but right arrow found at 38..40
ollie-scalameta@ """{
val (aa, bb) = tail.unzip: (IList[X], IList[Y])
(nel(a, aa), nel(b, bb))
}""".parse[Stat]
scala.meta.parsers.common.ParseException: ; expected but ( found at 58..59
// Minimal example
ollie-scalameta@ """ case x: (Bob[X] forSome { type X[_] }) => true""".parse[Case]
scala.meta.parsers.common.ParseException: identifier expected but true found at 44..48
// Big example
ollie-scalameta@ """class Bob[K[_]] {
def foo(other: Any) = other match {
case x: (Bob[X] forSome { type X[_] }) => true
case _ => false
}
}""".parse[Stat]
scala.meta.parsers.common.ParseException: identifier expected but true found at 103..107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment