Some tests for return types
This commit is contained in:
@@ -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
|
@Override
|
||||||
public void visitTypeProjection(JetTypeProjection typeProjection) {
|
public void visitTypeProjection(JetTypeProjection typeProjection) {
|
||||||
// TODO : Support Type Arguments. Class object may be initialized at this point");
|
// 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}
|
||||||
Reference in New Issue
Block a user