Tests fixed
This commit is contained in:
@@ -176,7 +176,7 @@ public class JetControlFlowProcessor {
|
||||
builder.writeNode(expression, left);
|
||||
}
|
||||
else {
|
||||
throw new UnsupportedOperationException("Assignments to " + left + " are not supported yet"); // TODO
|
||||
builder.unsupported(expression);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -270,6 +270,7 @@ public class TopDownAnalyzer {
|
||||
for (ValueParameterDescriptor valueParameterDescriptor : descriptor.getUnsubstitutedValueParameters()) {
|
||||
parameterScope.addPropertyDescriptor(valueParameterDescriptor);
|
||||
}
|
||||
parameterScope.addLabeledDeclaration(descriptor);
|
||||
|
||||
assert declaration instanceof JetFunction || declaration instanceof JetConstructor;
|
||||
JetDeclarationWithBody declarationWithBody = (JetDeclarationWithBody) declaration;
|
||||
@@ -283,9 +284,11 @@ public class TopDownAnalyzer {
|
||||
controlFlowDataTrace.close();
|
||||
|
||||
boolean preferBlock = true;
|
||||
FunctionDescriptorImpl functionDescriptorImpl = null;
|
||||
if (declaration instanceof JetFunction) {
|
||||
JetFunction jetFunction = (JetFunction) declaration;
|
||||
preferBlock = jetFunction.hasBlockBody();
|
||||
functionDescriptorImpl = (FunctionDescriptorImpl) descriptor;
|
||||
}
|
||||
|
||||
JetType returnType = resolveExpression(parameterScope, bodyExpression, preferBlock, controlFlowDataTrace);
|
||||
@@ -304,7 +307,7 @@ public class TopDownAnalyzer {
|
||||
if (safeReturnType == null) {
|
||||
safeReturnType = ErrorUtils.createErrorType("Unable to infer body type");
|
||||
}
|
||||
((FunctionDescriptorImpl) descriptor).setUnsubstitutedReturnType(safeReturnType);
|
||||
functionDescriptorImpl.setUnsubstitutedReturnType(safeReturnType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,4 +75,5 @@ public class FunctionDescriptorImpl extends DeclarationDescriptorImpl implements
|
||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitFunctionDescriptor(this, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class C {
|
||||
fun equals(a : Any?) : Int
|
||||
}
|
||||
|
||||
fun f(): Int {
|
||||
fun f(): Unit {
|
||||
var x: Int? = 1
|
||||
x = 1
|
||||
x <error>+</error> 1
|
||||
|
||||
@@ -5,7 +5,7 @@ class Dup {
|
||||
}
|
||||
|
||||
class A {
|
||||
fun foo() {
|
||||
fun foo() : Unit {
|
||||
this@A
|
||||
this<error>@a</error>
|
||||
this
|
||||
@@ -16,7 +16,7 @@ class A {
|
||||
val z = foo()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
fun foo() : Unit {
|
||||
<error>this</error>
|
||||
this<error>@a</error>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user