paulk-asert opened a new pull request, #2836:
URL: https://github.com/apache/groovy/pull/2836

   --check selected Phases.INSTRUCTION_SELECTION, so it reported success for 
sources that do not compile. Class verification and bytecode generation are 
both registered at Phases.CLASS_GENERATION, which the cutoff excluded, and each 
reports errors the earlier phases cannot: duplicate method signatures, illegal 
modifier combinations, abstract/final conflicts, and the direct field access 
diagnostics from StaticTypesCallSiteWriter.
   
   The two ideas behind --check — check without producing an artefact, and stop 
at a phase — line up at CLASS_GENERATION rather than before it. Bytecode is 
built in memory there; the class files are written in the OUTPUT phase that 
follows, and suppressing that is all a check needs. Selecting an earlier phase 
does not check less thoroughly for free, it just misses errors.
   
   --check now does more work than it did, since it generates bytecode it 
discards. That is the cost of its result being trustworthy.
   
   Earlier phases remain selectable through 
CompilerConfiguration.setTargetPhase and a compiler configuration script. 
Config scripts are processed after the option is applied, so a script overrides 
--check; the new test pins that, since it is the only route back to a shallower 
check.


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