File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
scip-semanticdb/src/main/java/com/sourcegraph/scip_semanticdb Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ public class SignatureFormatter {
23
23
24
24
private static final Type NOTHING_SYMBOL = typeRef ("scala/Nothing#" );
25
25
private static final String FUNCTION_SYMBOL_PREFIX = "scala/Function" ;
26
+ // Special case scala/Function object to not conflict with Function1 for example
27
+ private static final String FUNCTION_OBJECT = "scala/Function." ;
26
28
private static final String TUPLE_SYMBOL_PREFIX = "scala/Tuple" ;
27
29
private static final String ARRAY_SYMBOL = "scala/Array#" ;
28
30
private static final String ENUM_SYMBOL = "java/lang/Enum#" ;
@@ -557,7 +559,10 @@ private String formatType(Type type) {
557
559
b .append (formatType (typeRef .getTypeArguments (0 )));
558
560
b .append ("[]" );
559
561
}
560
- } else if (isScala && typeRef .getSymbol ().startsWith (FUNCTION_SYMBOL_PREFIX )) {
562
+ } else if (isScala
563
+ && typeRef .getSymbol ().startsWith (FUNCTION_SYMBOL_PREFIX )
564
+ && typeRef .getTypeArgumentsCount () > 0
565
+ && !typeRef .getSymbol ().startsWith (FUNCTION_OBJECT )) {
561
566
int n = typeRef .getTypeArgumentsCount () - 1 ;
562
567
if (n == 0 ) {
563
568
// Special-case for Function1[A, B]: don't wrap `A` in parenthesis like this `(A) => B`
You can’t perform that action at this time.
0 commit comments