use of ast.Ast.MethodType in project L42 by ElvisResearchGroup.
the class Test212_or_170_MethodTypes method testMapAll.
@Test
public void testMapAll() {
List<Map<MethodType, String>> maps = new ArrayList<>();
for (MethodType mt : dataSet) {
maps.add(fixMap(mt));
}
maps.stream().sorted((m1, m2) -> m1.size() - m2.size()).forEach(map -> {
System.out.println(mapToS(map));
});
}
use of ast.Ast.MethodType in project L42 by ElvisResearchGroup.
the class SumMethods method mtU.
static MethodType mtU(int index, MethodType mt1, MethodType mt2) {
Mdf mdfU = mdfU(mt1.getMdf(), mt2.getMdf());
if (mdfU == null) {
return null;
}
Type removed = mt2.getTs().get(index);
boolean isRemovedPh = !Functions.isComplete(removed);
List<Type> totTypes;
if (isRemovedPh) {
totTypes = new ArrayList<>(mt1.getTs());
} else {
totTypes = mt1.getTs().stream().map(t -> TypeManipulation.noFwd(t)).collect(Collectors.toList());
}
totTypes.addAll(mt2.getTs());
int toRemove = mt1.getTs().size() + index;
totTypes.remove(toRemove);
List<Type> exU = new ArrayList<>(mt1.getExceptions());
exU.addAll(mt2.getExceptions());
MethodType mtU = new MethodType(false, mdfU, totTypes, mt2.getReturnType(), exU);
return mtU;
}
use of ast.Ast.MethodType in project L42 by ElvisResearchGroup.
the class MakeKs method prototypeK.
//can not reuse the desugar one, here we create ExpCore stuff, also , the sugar one may disappear
private static MethodWithType prototypeK(Doc doc, List<String> fieldNames, List<Type> fieldTypes, Position pos) {
MethodSelector ms = MethodSelector.of("", fieldNames);
Type resT = Type.mutThis0;
MethodType mt = new MethodType(false, ast.Ast.Mdf.Class, fieldTypes, resT, Collections.emptyList());
return new MethodWithType(doc, ms, mt, Optional.empty(), pos);
}
Aggregations