blackdrag commented on code in PR #2817:
URL: https://github.com/apache/groovy/pull/2817#discussion_r3833359952


##########
src/main/java/org/codehaus/groovy/control/ResolveVisitor.java:
##########
@@ -110,6 +110,15 @@ public class ResolveVisitor extends 
ClassCodeExpressionTransformer {
      * Placeholder name used for wildcard generic arguments.
      */
     public static final String QUESTION_MARK = "?";
+    /**
+     * Node-metadata key under which a parser may store an explanatory suffix 
for a
+     * {@link CastExpression} whose type it suspects may fail to resolve — for 
example a
+     * cast produced by a grammar ambiguity. When the cast's type cannot be 
resolved, the
+     * stored text is appended to the {@code unable to resolve class} error 
message.
+     * The value is the complete hint text; this visitor attaches no meaning 
to it.
+     */
+    @Internal
+    public static final String CAST_RESOLVE_HINT = "_CAST_RESOLVE_HINT";

Review Comment:
   It looks better that way, but I am still not happy about this being such a 
specialized mechanism for just one thing, but spanning so much across packages 
and compilation phases. If we made this a more general mechanism and for 
example call it "_RESOLVE_HINT", then it would look better, but is it better? 
If it stays a single use case, then probably not. So I guess in combination 
with @Internal this is ok. We can still change it later if we really want to.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to