Skip to content

Commit

Permalink
metahost: fix issue with converting certain binding patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
mutcianm committed Jan 18, 2017
1 parent deb283a commit 8ef0681
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scala/meta/trees/TreeAdapter.scala
Expand Up @@ -190,6 +190,7 @@ trait TreeAdapter {
case t: ScWildcardPattern => Wildcard()
case t: ScCompositePattern => compose(Seq(t.subpatterns : _*))
case t: ScInfixPattern => ExtractInfix(pattern(t.leftPattern), toTermName(t.reference), t.rightPattern.map(pt=>Seq(pattern(pt))).getOrElse(Nil))
case t: ScStableReferenceElementPattern => toTermName(t.refElement.get)
case t: ScPattern => t ?!
}
}
Expand Down Expand Up @@ -277,7 +278,7 @@ trait TreeAdapter {
case t: ScUnitExpr =>
m.Lit(())
case t: ScReturnStmt =>
m.Term.Return(expression(t.expr).get)
m.Term.Return(expression(t.expr).getOrElse(m.Lit(())))
case t: ScBlockExpr if t.hasCaseClauses =>
m.Term.PartialFunction(Seq(t.caseClauses.get.caseClauses.map(caseClause):_*))
case t: ScBlock =>
Expand Down Expand Up @@ -348,7 +349,7 @@ trait TreeAdapter {
case t: ScInterpolatedStringLiteral =>
t ???
case t: ScParenthesisedExpr =>
t ???
t.expr.map(expression).getOrElse(unreachable)
case t: ScTypedStmt =>
t ???
case t: ScUnderscoreSection =>
Expand Down

0 comments on commit 8ef0681

Please sign in to comment.