Skip to content

Commit

Permalink
Fix for #1020: set zero name length for script's type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Jan 13, 2020
1 parent 53f8893 commit c73fca8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,7 @@ private void fixupSourceLocationsForTypeDeclaration(GroovyTypeDeclaration typeDe
} else {
// start and end of the type name; scripts do not have a name, so use start instead
typeDeclaration.sourceStart = Math.max(classNode.getNameStart(), classNode.getStart());
typeDeclaration.sourceEnd = Math.max(classNode.getNameEnd(), classNode.getStart()); // incl. extends/implements?
typeDeclaration.sourceEnd = Math.max(classNode.getNameEnd(), classNode.getStart() - 1);

// start and end of the entire declaration including Javadoc and ending at the last close bracket
Javadoc doc = findJavadoc(classNode.getLineNumber());
Expand Down

0 comments on commit c73fca8

Please sign in to comment.