Skip to content

Commit

Permalink
Scala fix (#4683)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Feb 1, 2023
1 parent ba5a97c commit b2ecedf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/compilers/java.ts
Expand Up @@ -382,10 +382,13 @@ export class JavaCompiler extends BaseCompiler {
}
return {
// Used for sorting
firstSourceLine: methods.reduce(
(p, m) => (p === -1 ? unwrap(m.startLine) : Math.min(p, unwrap(m.startLine))),
-1,
),
firstSourceLine: methods.reduce((prev, method) => {
if (method.startLine) {
return prev === -1 ? method.startLine : Math.min(prev, method.startLine);
} else {
return prev;
}
}, -1),
methods: methods,
textsBeforeMethod,
};
Expand Down

0 comments on commit b2ecedf

Please sign in to comment.