Some tests for return types

This commit is contained in:
Andrey Breslav
2011-04-05 16:16:23 +04:00
parent 83e0018b06
commit b621f58a83
2 changed files with 26 additions and 0 deletions
@@ -438,6 +438,14 @@ public class JetControlFlowProcessor {
}
}
@Override
public void visitTupleExpression(JetTupleExpression expression) {
for (JetExpression entry : expression.getEntries()) {
value(entry, false);
}
builder.readNode(expression);
}
@Override
public void visitTypeProjection(JetTypeProjection typeProjection) {
// TODO : Support Type Arguments. Class object may be initialized at this point");
@@ -0,0 +1,18 @@
<error>fun none()</error>
fun unitEmptyInfer() {}
fun unitEmpty() : Unit {}
fun unitEmptyReturn() : Unit {return}
fun unitShort() : Unit = ()
fun unitShortConv() : Unit = 1
fun unitShortNull() : Unit = null
<error>fun intEmpty() : Int {}</error>
fun intShortInfer() = 1
fun intShort() : Int = 1
fun intBlockInfer() {1}
fun intBlock() : Int {1}
fun blockReturnUnitMismatch() : Int {<error>return</error>}
fun blockReturnValueTypeMismatch() : Int {return <error>3.4</error>}
fun blockReturnValueTypeMatch() : Int {return 1}