Skip to content

Commit

Permalink
I flipped the wrong format type
Browse files Browse the repository at this point in the history
  • Loading branch information
ZZZank committed Aug 2, 2024
1 parent e03f3c3 commit 2c3bd1d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ public List<String> format(Declaration declaration, FormatType formatType) {
// (arg0: type, arg1: type...) => returnType
return Collections.singletonList(String.format(
"(%s => %s)",
ParamDecl.formatParams(params, declaration, formatType),
//formatType for return should be flipped, to provide better support for type wrapper
returnType.line(declaration, formatType == FormatType.INPUT ? FormatType.RETURN : FormatType.INPUT)
//when formatType is INPUT, aka this lambda is a param itself, params of this lambda should be concrete
ParamDecl.formatParams(
params,
declaration,
formatType == FormatType.INPUT ? FormatType.RETURN : FormatType.INPUT
),
returnType.line(declaration, formatType)
));
}

Expand Down

0 comments on commit 2c3bd1d

Please sign in to comment.