Fix
This commit is contained in:
parent
e1f579664a
commit
a71e56ea97
@ -1,5 +1,6 @@
|
||||
package de.dhbwstuttgart.typeinference.assumptions;
|
||||
|
||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.TypeScope;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||
@ -25,7 +26,7 @@ public class FieldAssumption extends Assumption{
|
||||
}
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReceiverType(GenericsResolver resolver) {
|
||||
|
||||
return null;
|
||||
//TODO
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,8 @@ public class MethodAssumption extends Assumption{
|
||||
return receiver;
|
||||
}
|
||||
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
|
||||
public RefTypeOrTPHOrWildcardOrGeneric getReturnType(GenericsResolver resolver) {
|
||||
if(retType instanceof GenericRefType)return resolver.resolve(retType);
|
||||
return retType;
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ public class TYPEStmt implements StatementVisitor{
|
||||
for(Method m : cl.getMethods()){
|
||||
if(m.getName().equals(name) &&
|
||||
m.getParameterList().getFormalparalist().size() == numArgs){
|
||||
RefTypeOrTPHOrWildcardOrGeneric retType = info.checkGTV(m.getReturnType());
|
||||
RefTypeOrTPHOrWildcardOrGeneric retType = m.getReturnType();//info.checkGTV(m.getReturnType());
|
||||
|
||||
ret.add(new MethodAssumption(cl, retType, convertParams(m.getParameterList(),info),
|
||||
createTypeScope(cl, m)));
|
||||
|
@ -49,6 +49,10 @@ public class JavaTXCompilerTest {
|
||||
execute(new File(rootDirectory+"Generics.jav"));
|
||||
}
|
||||
@Test
|
||||
public void genericsMethodCall() throws IOException, ClassNotFoundException {
|
||||
execute(new File(rootDirectory+"MethodCallGenerics.jav"));
|
||||
}
|
||||
@Test
|
||||
public void faculty() throws IOException, ClassNotFoundException {
|
||||
execute(new File(rootDirectory+"Faculty.jav"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user