Package: groovy.typecheckers

## [Groovy] Class CombinerChecker

- groovy.typecheckers.CombinerChecker

-     @Incubating
      class CombinerChecker
      extends TypeCheckingDSL

  A compile-time checker that verifies the combiner passed to an order-independent parallel reduction (`sumParallel`, `injectParallel`) carries the associativity contract those methods silently require — mirroring the design of `PurityChecker`.

  Associativity is undecidable in general, so this checker is deliberately conservative. It has two modes, selected via the extension option `mode`:

       // default (lenient): only flag high-confidence problems
       @TypeChecked(extensions = 'groovy.typecheckers.CombinerChecker')

       // strict: additionally require the combiner to be declared @Associative/@Reducer
       @TypeChecked(extensions = "groovy.typecheckers.CombinerChecker(mode: 'strict')")

  What it does, by combiner shape:

  - Method reference to a method annotated Associative or Reducer — accepted.
  - Inline closure whose combine expression applies a non-associative operator (`-`, `/`, `%`, `**`) directly to the two combiner parameters (e.g. `{ a, b -> a - b }`) — flagged in any mode (high confidence).
  - `injectParallel` seed that contradicts a `@Reducer`'s declared `zero()` (both statically constant) — flagged.
  - Un-annotated method references and other inline closures — flagged only in strict mode (a declared, verifiable contract is required).
  The default mode never errors on an ordinary associative inline closure such as `{ a, b -> a + b }`; the single error channel of a type-checking extension makes false-positive aversion essential.
  Since:
    6.0.0
  See Also:
    Associative
    Reducer

- - ### Constructor Summary

    Constructors
    Constructor and description
    `CombinerChecker()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `Object` | `run()`

- - ### Constructor Detail

    - #### CombinerChecker()

  - ### Method Detail

    - #### @Override
      Object run()