You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2018/02/17 16:43:50 UTC
groovy git commit: Revert error message for invalid `void`
Repository: groovy
Updated Branches:
refs/heads/master 2ac5b4852 -> a1a374674
Revert error message for invalid `void`
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a1a37467
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a1a37467
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a1a37467
Branch: refs/heads/master
Commit: a1a37467411d14913628157533951f9b63dad4b8
Parents: 2ac5b48
Author: danielsun1106 <re...@hotmail.com>
Authored: Sun Feb 18 00:43:41 2018 +0800
Committer: danielsun1106 <re...@hotmail.com>
Committed: Sun Feb 18 00:43:41 2018 +0800
----------------------------------------------------------------------
.../main/java/org/apache/groovy/parser/antlr4/AstBuilder.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/a1a37467/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 6c02297..bd72215 100644
--- a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -3878,7 +3878,10 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
}
if (!asBoolean(classNode)) {
- // TODO refine error message for `void`
+ if (VOID_STR.equals(ctx.getText())) { // TODO refine error message for `void`
+ throw createParsingFailedException("void is not allowed here", ctx);
+ }
+
throw createParsingFailedException("Unsupported type: " + ctx.getText(), ctx);
}