translator: fix *this transfer
This commit is contained in:
@@ -194,9 +194,12 @@ class FunctionCodegen(val state: TranslationState, val variableManager: Variable
|
||||
val methodName = clazz.clazz.name.toString() + '.' + selectorName.substringBefore('(')
|
||||
val method = clazz.methods[methodName]!!
|
||||
val returnType = clazz.methods[methodName]!!.returnType.type
|
||||
val methodArgs = mutableListOf<LLVMSingleValue>(receiver)
|
||||
|
||||
val names = parseArgList(expr.lastChild as KtCallExpression, scopeDepth)
|
||||
return evaluateFunctionCallExpression(LLVMVariable(methodName, returnType, scope = LLVMRegisterScope()), names, method.args)
|
||||
methodArgs.addAll(names)
|
||||
|
||||
return evaluateFunctionCallExpression(LLVMVariable(methodName, returnType, scope = LLVMVariableScope()), methodArgs, method.args)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
simply_class_1(6789) == 6794
|
||||
@@ -0,0 +1,15 @@
|
||||
annotation class Native(val type: String = "")
|
||||
|
||||
@Native
|
||||
class classname_A(@Native("i32") val x: Int) {
|
||||
|
||||
fun method(): Int {
|
||||
return this.x + 5
|
||||
}
|
||||
}
|
||||
|
||||
fun simply_class_1(zz: Int) : Int{
|
||||
val x = classname_A(zz)
|
||||
val r = x.method()
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user