Copilot commented on code in PR #2836:
URL: https://github.com/apache/groovy/pull/2836#discussion_r3876146930


##########
src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java:
##########
@@ -504,11 +504,16 @@ public void setLogClassgenStackTraceMaxDepth(int 
logClassgenStackTraceMaxDepth)
 
     /**
      * The target compile phase: the last phase to be processed when
-     * {@link CompilationUnit#compile()} is called without an explicit phase
-     * (GROOVY-12204). Defaults to {@link Phases#ALL}. An earlier phase, such 
as
-     * {@link Phases#INSTRUCTION_SELECTION}, gives a check-only compilation
-     * which reports parse, resolution, and static type-checking errors without
-     * generating class files.
+     * {@link CompilationUnit#compile()} is called without an explicit phase.
+     * Defaults to {@link Phases#ALL}.
+     * <p>
+     * {@link Phases#CLASS_GENERATION} gives a check-only compilation: every 
check runs,
+     * but the class files are never written, because that happens in {@link 
Phases#OUTPUT}.
+     * This is what {@code groovyc --check} selects.

Review Comment:
   This updated Javadoc correctly describes CLASS_GENERATION as the check-only 
cutoff used by `groovyc --check`, but 
`CompilerConfiguration#setTargetPhase(int)` further down in this same file 
still documents `--check` as selecting `INSTRUCTION_SELECTION`. Please update 
the setter (and any related docs) to match, otherwise readers will get 
contradictory guidance about which phase `--check` uses.



-- 
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