diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-02 15:54:16 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:13:00 +0200 |
commit | e5119a058ff11cc0cca565c22c29f090401d794b (patch) | |
tree | 3e3ee85bae8b26dd18df108ee7804927c16e148b /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 6821bac06b34c416ca94216025b864e73592cbe7 (diff) | |
download | dotty-e5119a058ff11cc0cca565c22c29f090401d794b.tar.gz dotty-e5119a058ff11cc0cca565c22c29f090401d794b.tar.bz2 dotty-e5119a058ff11cc0cca565c22c29f090401d794b.zip |
Address @smarter's review comments
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index fb7f26f36..e32805e0f 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1357,7 +1357,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def typedTypedSplice(tree: untpd.TypedSplice)(implicit ctx: Context): Tree = tree.tree match { case tree1: TypeTree => tree1 // no change owner necessary here ... - case tree1: Ident => tree1 // ... or here + case tree1: Ident => tree1 // ... or here, since these trees cannot contain bindings case tree1 => if (ctx.owner ne tree.owner) tree1.changeOwner(tree.owner, ctx.owner) else tree1 @@ -1859,7 +1859,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (folded ne tree) return adaptConstant(folded, folded.tpe.asInstanceOf[ConstantType]) // drop type if prototype is Unit if (pt isRef defn.UnitClass) - return tpd.Block(tree :: Nil, Literal(Constant(()))) + return adapt(tpd.Block(tree :: Nil, Literal(Constant(()))), pt) // convert function literal to SAM closure tree match { case Closure(Nil, id @ Ident(nme.ANON_FUN), _) |