diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-09 23:36:26 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | d1b933cac3380edcade3891aec6ed731744b2e13 (patch) | |
tree | 3aaacf9b18247f25682c1682f21d2cbf1038c0ee /src | |
parent | 184296f694d3623098864b8313b2ed7ccf7380f1 (diff) | |
download | dotty-d1b933cac3380edcade3891aec6ed731744b2e13.tar.gz dotty-d1b933cac3380edcade3891aec6ed731744b2e13.tar.bz2 dotty-d1b933cac3380edcade3891aec6ed731744b2e13.zip |
Fix bug in InlineableClosure
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/typer/Inliner.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Inliner.scala b/src/dotty/tools/dotc/typer/Inliner.scala index 546988d21..c640244c4 100644 --- a/src/dotty/tools/dotc/typer/Inliner.scala +++ b/src/dotty/tools/dotc/typer/Inliner.scala @@ -494,9 +494,9 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) { lazy val paramProxies = paramProxy.values.toSet def unapply(tree: Ident)(implicit ctx: Context): Option[Tree] = if (paramProxies.contains(tree.tpe)) { - bindingsBuf.find(_.name == tree.name).get.rhs match { - case Closure(_, meth, _) if meth.symbol.isInlineMethod => Some(meth) - case Block(_, Closure(_, meth, _)) if meth.symbol.isInlineMethod => Some(meth) + bindingsBuf.find(_.name == tree.name).map(_.rhs) match { + case Some(Closure(_, meth, _)) if meth.symbol.isInlineMethod => Some(meth) + case Some(Block(_, Closure(_, meth, _))) if meth.symbol.isInlineMethod => Some(meth) case _ => None } } else None |