Skip to content

Commit

Permalink
fixed type hint for return expression extracts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Nov 25, 2024
1 parent 7e16139 commit ed57f56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/refactor/refactor/extractmethod/CodeGenAsExpression.hx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class CodeGenAsExpression extends CodeGenBase {
}
return Promise.resolve(":" + typeHint.printTypeHint());
});
case Kwd(KwdReturn):
return parentTypeHint().then(function(typeHint):Promise<String> {
if (typeHint == null) {
return Promise.resolve("");
}
return Promise.resolve(":" + typeHint.printTypeHint());
});
default:
}
return TypingHelper.findTypeWithTyper(context, context.what.fileName, extractData.endToken.pos.max - 1).then(function(typeHint):Promise<String> {
Expand Down

0 comments on commit ed57f56

Please sign in to comment.