Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -256,28 +256,23 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
iv.invokespecial(funClass, "<init>", "(Ljet/TypeInfo;)V");
|
||||
|
||||
i = 1;
|
||||
int k = 0;
|
||||
for (Type type : argTypes) {
|
||||
StackValue.local(0, JetTypeMapper.TYPE_OBJECT).put(JetTypeMapper.TYPE_OBJECT, iv);
|
||||
StackValue.local(i, type).put(type, iv);
|
||||
final String fieldName;
|
||||
if (captureThis && i == 1) {
|
||||
fieldName = "this$0";
|
||||
i++;
|
||||
k++;
|
||||
}
|
||||
else {
|
||||
if (captureReceiver != null && (captureThis && i == 2 || !captureThis && i == 1)) {
|
||||
fieldName = "receiver$0";
|
||||
i++;
|
||||
k++;
|
||||
}
|
||||
else {
|
||||
VariableDescriptor removed = variableDescriptors.remove(0);
|
||||
fieldName = "$" + removed.getName();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
i += type.getSize();
|
||||
|
||||
StackValue.field(type, name, fieldName, false).store(iv);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fun box() : String {
|
||||
val fps : Double = 1.dbl
|
||||
var mspf : Long
|
||||
{
|
||||
if ((fps.int == 0))
|
||||
mspf = 0
|
||||
else
|
||||
mspf = (((1000.0 / fps)).lng)
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
@@ -41,6 +41,10 @@ public class FunctionGenTest extends CodegenTestCase {
|
||||
// blackBoxFile("regressions/kt785.jet");
|
||||
}
|
||||
|
||||
public void testKt873 () {
|
||||
blackBoxFile("regressions/kt873.kt");
|
||||
}
|
||||
|
||||
public void testFunction () throws InvocationTargetException, IllegalAccessException {
|
||||
blackBoxFile("functions/functionExpression.jet");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user