Typechecker logic fixed for one-branch ifs and 'return x' for Unit-returning functions
This commit is contained in:
@@ -36,7 +36,7 @@ l5:
|
||||
<END>
|
||||
=====================
|
||||
== nonlocals1 ==
|
||||
fun nonlocals1(a : Boolean, b : Boolean) : Unit {
|
||||
fun nonlocals1(a : Boolean, b : Boolean) : Any? {
|
||||
if (a)
|
||||
return 1
|
||||
1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun nonlocals1(a : Boolean, b : Boolean) : Unit {
|
||||
fun nonlocals1(a : Boolean, b : Boolean) : Any? {
|
||||
if (a)
|
||||
return 1
|
||||
1
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
fun unitEmptyInfer() {}
|
||||
fun unitEmpty() : Unit {}
|
||||
fun unitEmptyReturn() : Unit {return}
|
||||
fun unitIntReturn() : Unit {return <error>1</error>}
|
||||
fun unitUnitReturn() : Unit {return ()}
|
||||
fun unitShort() : Unit = ()
|
||||
fun unitShortConv() : Unit = 1
|
||||
fun unitShortNull() : Unit = null
|
||||
|
||||
Reference in New Issue
Block a user