Package: groovy.typecheckers

## [Groovy] Class MonadicShapeChecker

- groovy.typecheckers.MonadicShapeChecker

-     @Incubating
      class MonadicShapeChecker
      extends TypeCheckingDSL

  Compile-time lint for native monadic chains over the standard carrier allow-list (MonadicCarrierRegistry).

  Sister to MonadicChecker: that one repairs erasure on calls routed through the `DO` macro's runtime dispatcher; this one catches shape bugs in hand-written `flatMap`/`map` (and `thenCompose`/`thenApply`/etc.) chains that the JDK generics cannot reject:

  - `bind` returning a non-carrier — e.g. `Optional.flatMap { it + 1` } where the JDK expects an `Optional`. STC can silently let closures pass this gap.
  - `bind` returning a different carrier — e.g. `Stream.flatMap { Optional.of(it)` }. Almost certainly a bug.
  - `map` returning the same carrier — e.g. `Optional.map { Optional.of(it)` } producing `Optional<Optional<T>>`; usually a missed `flatMap` (or `thenCompose`).
  Carriers, and the canonical names of their bind/map methods, are read entirely from MonadicCarrierRegistry; types annotated Monadic also participate (matched by simple name, like `@Reducer`). Calls whose target is `Comprehensions` are skipped — they are MonadicChecker's domain.

  Two modes, selected via the extension option `mode`:

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

       // strict: also flag chains whose function return cannot be statically resolved
       @TypeChecked(extensions = "groovy.typecheckers.MonadicShapeChecker(mode: 'strict')")

  Since:
    6.0.0
  See Also:
    MonadicCarrierRegistry
    MonadicChecker
    Monadic

- - ### Constructor Summary

    Constructors
    Constructor and description
    `MonadicShapeChecker()`

  - ### Methods Summary

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

- - ### Constructor Detail

    - #### MonadicShapeChecker()

  - ### Method Detail

    - #### @Override
      Object run()