Skip to content

Commit 46ef27e

Browse files
committed
fix: ensure typeArgumentsCount > 0 to process them
This change just skips the block to process the type arguments if there are no type arguments. Closes #475
1 parent 71eccc5 commit 46ef27e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scip-semanticdb/src/main/java/com/sourcegraph/scip_semanticdb/SignatureFormatter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class SignatureFormatter {
2323

2424
private static final Type NOTHING_SYMBOL = typeRef("scala/Nothing#");
2525
private static final String FUNCTION_SYMBOL_PREFIX = "scala/Function";
26-
// Special case scala/Function object to not confluce with Function1 for example
26+
// Special case scala/Function object to not conflict with Function1 for example
2727
private static final String FUNCTION_OBJECT = "scala/Function.";
2828
private static final String TUPLE_SYMBOL_PREFIX = "scala/Tuple";
2929
private static final String ARRAY_SYMBOL = "scala/Array#";
@@ -561,6 +561,7 @@ private String formatType(Type type) {
561561
}
562562
} else if (isScala
563563
&& typeRef.getSymbol().startsWith(FUNCTION_SYMBOL_PREFIX)
564+
&& typeRef.getTypeArgumentsCount() > 0
564565
&& !typeRef.getSymbol().startsWith(FUNCTION_OBJECT)) {
565566
int n = typeRef.getTypeArgumentsCount() - 1;
566567
if (n == 0) {

0 commit comments

Comments
 (0)