Änderung sodass OLFun2 nun den Rückgabetyp des Funktionstyps auch zurückgibt.
Anpassung entsprechend in den Tests.
This commit is contained in:
parent
a0367d5464
commit
1cf1c99e72
@ -592,7 +592,6 @@ public class BytecodeGenMethod implements StatementVisitor {
|
||||
this.lamCounter++;
|
||||
|
||||
String typeErasure = createDescriptorWithTypeErasure(lambdaExpression);
|
||||
//ToDo Etienne: Double Check
|
||||
RefTypeOrTPHOrWildcardOrGeneric returnType = resolver.resolve(lambdaExpression.getReturnType());
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes = lambdaExpression
|
||||
.params
|
||||
@ -828,7 +827,6 @@ public class BytecodeGenMethod implements StatementVisitor {
|
||||
} else if(!helper.isInCurrPkg(clazz)){
|
||||
if(clazz.contains(CONSTANTS.$$)) {
|
||||
mDesc = helper.getDescriptorOfApplyMethod(methCallType);
|
||||
//ToDo Etienne: Double Check
|
||||
RefTypeOrTPHOrWildcardOrGeneric returnType = resolver.resolve(methodCall.getType());
|
||||
List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes = methodCall
|
||||
.arglist
|
||||
|
@ -153,7 +153,6 @@ public class DescriptorToString implements DescriptorVisitor, CONSTANTS {
|
||||
return desc;
|
||||
}
|
||||
|
||||
//ToDo Etienne: ändern
|
||||
@Override
|
||||
public String visit(Lambda lambdaExpression) {
|
||||
String desc = "(";
|
||||
|
@ -47,24 +47,28 @@ public class OLFun2Test {
|
||||
@Test
|
||||
public void mExistsWithIntegerInteger() throws Exception{
|
||||
Method m = classToTest.getDeclaredMethod("m", classFun1IntInt);
|
||||
assertEquals(Integer.class, m.getReturnType());
|
||||
assertNotNull(m);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mExistsWithIntegerDouble() throws Exception{
|
||||
Method m = classToTest.getDeclaredMethod("m", classFun1IntDouble);
|
||||
assertEquals(Double.class, m.getReturnType());
|
||||
assertNotNull(m);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mExistsWithDoubleInteger() throws Exception{
|
||||
Method m = classToTest.getDeclaredMethod("m", classFun1DoubleInt);
|
||||
assertEquals(Integer.class, m.getReturnType());
|
||||
assertNotNull(m);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mExistsWithDoubleDouble() throws Exception{
|
||||
Method m = classToTest.getDeclaredMethod("m", classFun1DoubleDouble);
|
||||
assertEquals(Double.class, m.getReturnType());
|
||||
assertNotNull(m);
|
||||
}
|
||||
|
||||
|
@ -9,5 +9,6 @@ public class OLFun2 {
|
||||
m(f){
|
||||
var x = 1;
|
||||
var y = f.apply(x + x) + 1;
|
||||
return y;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user