Skip to content

Commit 3023cee

Browse files
Merge pull request #1823 from dotty-staging/fix-#1789
Fix #1789: Fix signature of unit result type
2 parents 46bef71 + 1846ad5 commit 3023cee

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
@@ -2276,11 +2276,13 @@ object Types {
22762276

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

0 commit comments

Comments
 (0)