Skip to content

Commit

Permalink
Return type on constructors should be null after jls2
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
Rob Stryker committed Apr 5, 2024
1 parent 01f1b97 commit 29c5a1a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private MethodDeclaration convertMethodDecl(JCMethodDecl javac, ASTNode parent)
JCTree retTypeTree = javac.getReturnType();
Type retType = null;
if( retTypeTree == null ) {
if( isConstructor ) {
if( isConstructor && this.ast.apiLevel == AST.JLS2_INTERNAL ) {
retType = this.ast.newPrimitiveType(convert(TypeKind.VOID));
// // TODO need to find the right range
retType.setSourceRange(javac.mods.pos + getJLS2ModifiersFlagsAsStringLength(javac.mods.flags), 0);
Expand Down

0 comments on commit 29c5a1a

Please sign in to comment.