scala.MatchError: 1 (of class scala.meta.Lit$LitImpl)
Closed this issue · 7 comments
olafurpg commented
git clone https://github.com/scalacenter/scalafix.git
cd scalafix
coursier launch co.pjrt:stags-cli_2.12:0.1.1 -- ./
Exception in thread "main" scala.MatchError: 1 (of class scala.meta.Lit$LitImpl)
at co.pjrt.stags.TagGenerator$.getFromPats(TagGenerator.scala:127)
at co.pjrt.stags.TagGenerator$.getFromPat$1(TagGenerator.scala:118)
at co.pjrt.stags.TagGenerator$.$anonfun$getFromPats$2(TagGenerator.scala:124)
at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:241)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:241)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:238)
at scala.collection.immutable.List.flatMap(List.scala:352)
at co.pjrt.stags.TagGenerator$.getFromPats(TagGenerator.scala:124)
at co.pjrt.stags.TagGenerator$.$anonfun$tagsForStatement$1(TagGenerator.scala:71)
at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:241)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:241)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:238)
Seems like
is missing a fallback.pjrt commented
Oh, thanks for reporting! Yes, I purposely didn't put a catch-all because I
wanted to see how and where it would fail (so that I can create the proper
tag, or ignore it otherwise).
I'll fix this as soon as I get to my PC.
…On Fri, Jul 14, 2017, 05:56 Ólafur Páll Geirsson ***@***.***> wrote:
git clone https://github.com/scalacenter/scalafix.git
cd scalafix
coursier launch co.pjrt:stags-cli_2.12:0.1.1 -- ./
Exception in thread "main" scala.MatchError: 1 (of class scala.meta.Lit$LitImpl)
at co.pjrt.stags.TagGenerator$.getFromPats(TagGenerator.scala:127)
at co.pjrt.stags.TagGenerator$.getFromPat$1(TagGenerator.scala:118)
at co.pjrt.stags.TagGenerator$.$anonfun$getFromPats$2(TagGenerator.scala:124)
at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:241)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:241)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:238)
at scala.collection.immutable.List.flatMap(List.scala:352)
at co.pjrt.stags.TagGenerator$.getFromPats(TagGenerator.scala:124)
at co.pjrt.stags.TagGenerator$.$anonfun$tagsForStatement$1(TagGenerator.scala:71)
at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:241)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:241)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:238)
Seems like
https://github.com/pjrt/stags/blob/dcb70615607fb46e9becc18f68ff66c35f7dc3c3/stags/src/main/scala/co/pjrt/stags/TagGenerator.scala#L130
is missing a fallback.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABiRtBQOeCgEf3Eukjs4NEer3Qc7T_J-ks5sNzsvgaJpZM4OYDop>
.
olafurpg commented
If you want a large corpus you can try https://github.com/olafurpg/scala-repos/
Alternatively, scalameta testkit provides a nice interface to run custom analysis on that same corpus https://github.com/scalameta/scalameta/blob/1bd511158352bd6375bdb1e0e28395e76513094f/scalameta/testkit/src/main/scala/scala/meta/testkit/SyntaxAnalysis.scala
pjrt commented
Nice, thanks! I'll see if I can integrate it into my tests.
pjrt commented
Fixed. I'll push to maven later today (or tomorrow. idk if I'll have time today).
olafurpg commented
Thanks for the fix! I'm slowly trying to move from IJ to vim and I hope to use stags to smoothen the transition 😄
olafurpg commented
Awesome, just ran it on the scalafix repo with no problem 💯