Skip to content

Commit 1846ad5

Browse files
committed
Fix #1789: Fix signature of unit result type
was scala.BoxedUnit, should be scala.Unit.
1 parent 5df985c commit 1846ad5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,11 +2275,13 @@ object Types {
22752275

22762276
protected def resultSignature(implicit ctx: Context) = try resultType match {
22772277
case rtp: MethodicType => rtp.signature
2278-
case tp => Signature(tp, isJava = false)
2278+
case tp =>
2279+
if (tp.isRef(defn.UnitClass)) Signature(Nil, defn.UnitClass.fullName.asTypeName)
2280+
else Signature(tp, isJava = false)
22792281
}
22802282
catch {
22812283
case ex: AssertionError =>
2282-
println(i"failure while taking result signture of $this: $resultType")
2284+
println(i"failure while taking result signature of $this: $resultType")
22832285
throw ex
22842286
}
22852287

0 commit comments

Comments
 (0)