mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
[ghidra-stubs] Handle void return type
This commit is contained in:
@@ -225,6 +225,10 @@ final class PythonTypeStubMethod extends PythonTypeStubElement<ExecutableElement
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type.getKind() == TypeKind.VOID) {
|
||||||
|
return "None";
|
||||||
|
}
|
||||||
|
|
||||||
if (type instanceof DeclaredType dt) {
|
if (type instanceof DeclaredType dt) {
|
||||||
Element element = dt.asElement();
|
Element element = dt.asElement();
|
||||||
if (element instanceof QualifiedNameable nameable) {
|
if (element instanceof QualifiedNameable nameable) {
|
||||||
@@ -314,15 +318,13 @@ final class PythonTypeStubMethod extends PythonTypeStubElement<ExecutableElement
|
|||||||
printer.print(")");
|
printer.print(")");
|
||||||
|
|
||||||
TypeMirror res = el.getReturnType();
|
TypeMirror res = el.getReturnType();
|
||||||
if (res.getKind() != TypeKind.VOID) {
|
printer.print(" -> ");
|
||||||
printer.print(" -> ");
|
String convertedType = convertResultType(res);
|
||||||
String convertedType = convertResultType(res);
|
if (convertedType != null) {
|
||||||
if (convertedType != null) {
|
printer.print(convertedType);
|
||||||
printer.print(convertedType);
|
}
|
||||||
}
|
else {
|
||||||
else {
|
printer.print(sanitizeQualifiedName(res));
|
||||||
printer.print(sanitizeQualifiedName(res));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user