Package: groovy.typecheckers

## [Groovy] Class PurityChecker

- groovy.typecheckers.PurityChecker

-     @Incubating
      class PurityChecker
      extends TypeCheckingDSL

  A compile-time checker that verifies `@Pure` methods have no side effects.

  By default, strict purity is enforced: no field mutations, no I/O, no logging, no non-deterministic calls. The `allows` option declares which effect categories are tolerated:

       // Strict: no side effects at all
       @TypeChecked(extensions = 'groovy.typecheckers.PurityChecker')

       // Tolerate logging and metrics
       @TypeChecked(extensions = 'groovy.typecheckers.PurityChecker(allows: "LOGGING|METRICS")')

  Effect categories:

  - `LOGGING` — calls to logging frameworks (SLF4J, JUL, etc.) and `println`
  - `METRICS` — calls to metrics instruments (Micrometer, OpenTelemetry, etc.)
  - `IO` — file, network, database, and console I/O
  - `NONDETERMINISM` — time-dependent, random, and environment-dependent calls

  Also recognises:

  - `@SideEffectFree` (Checker Framework) — treated as `@Pure` with implicit NONDETERMINISM allowed
  - `@Contract(pure = true)` (JetBrains) — treated as `@Pure`
  - `@Memoized` — treated as effectively pure
  Since:
    6.0.0
  See Also:
    Pure

- - ### Constructor Summary

    Constructors
    Constructor and description
    `PurityChecker()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `Object` | `run()` Registers purity checks for annotated methods encountered during type checking.

- - ### Constructor Detail

    - #### PurityChecker()

  - ### Method Detail

    - #### @Override
      Object run()

      Registers purity checks for annotated methods encountered during type checking.