From 1846ad5850fa20a66ca0b627ef9d15be5f066e4e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 18 Dec 2016 15:16:45 +0100 Subject: Fix #1789: Fix signature of unit result type was scala.BoxedUnit, should be scala.Unit. --- compiler/src/dotty/tools/dotc/core/Types.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/core') diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 4dffc4542..7a7a6ada8 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2275,11 +2275,13 @@ object Types { protected def resultSignature(implicit ctx: Context) = try resultType match { case rtp: MethodicType => rtp.signature - case tp => Signature(tp, isJava = false) + case tp => + if (tp.isRef(defn.UnitClass)) Signature(Nil, defn.UnitClass.fullName.asTypeName) + else Signature(tp, isJava = false) } catch { case ex: AssertionError => - println(i"failure while taking result signture of $this: $resultType") + println(i"failure while taking result signature of $this: $resultType") throw ex } -- cgit v1.2.3