Skip to content

Commit 093a20a

Browse files
committed
Don't save return value of entry point unless it's used
This fixes compile errors where return type is private
1 parent 011c540 commit 093a20a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

env-model-generator/src/createEntryPoint.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ function createEntryPoint(entryPoint: EntryPoint): Method {
4242

4343
statements.push(new Declaration(entryPoint.className, "mainClass", mainClassConstruction));
4444
const entryPointCall = new FnCall(`mainClass.${entryPoint.method.name}`, argConstructionCalls);
45-
if (entryPoint.method.returnType === "void")
46-
statements.push(new FnStatement(entryPointCall));
47-
else
48-
statements.push(new Declaration(entryPoint.method.returnType, "result", entryPointCall));
45+
// TODO: For particular types where we need an artificlal sink, test entryPoint.method.returnType, then insert a Declaration and a call to the sink
46+
statements.push(new FnStatement(entryPointCall));
4947

5048
return new Method(`public static void ${makeIdentifier(entryPoint.className)}_${makeIdentifier(entryPoint.method.name)}_entryPoint()`,
5149
statements, ["Exception"]);

0 commit comments

Comments
 (0)