diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-12-18 16:13:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-18 16:13:53 +0100 |
commit | 3023cee4739fc974eebdc8b2f3134a85507864a6 (patch) | |
tree | ffa7ab290795b0f495190a6d334637ee2c7763f0 /compiler | |
parent | 46bef7170fb48c0e48d0c5b38fcec29db64f7b13 (diff) | |
parent | 1846ad5850fa20a66ca0b627ef9d15be5f066e4e (diff) | |
download | dotty-3023cee4739fc974eebdc8b2f3134a85507864a6.tar.gz dotty-3023cee4739fc974eebdc8b2f3134a85507864a6.tar.bz2 dotty-3023cee4739fc974eebdc8b2f3134a85507864a6.zip |
Merge pull request #1823 from dotty-staging/fix-#1789
Fix #1789: Fix signature of unit result type
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 93c381c4c..069b4f60d 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2276,11 +2276,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 } |