mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-01 21:19:03 +00:00
Fixes #19240.
The Manual's "Delegating bind statements" example didn't compile (module
B didn't import A, type `O` wasn't exported, and `x: T` couldn't bind to
`var O`), and once those were fixed it compiled *without* the `bind`
statement — so it didn't demonstrate delegating bind at all.
This replaces it with a minimal example that genuinely requires `bind
init`: `module main` imports A and B but not C, so `init` is not in
scope at the final instantiation of `genericA`; the open `mixin` symbol
fails to resolve without `bind init` forwarding it from module B.
Verified to fail without `bind` and compile with `bind` under Nim
2.2.10.
---
Disclosure: I work with Claude as a co-processor. I understand what I'm
submitting and I verified the example against the compiler myself. If
you prefer human-only contributions, just say so and I'll close without
friction.
(cherry picked from commit c292ab987b)
============================ Nim's documentation system ============================ This folder contains Nim's documentation. The documentation is written in a format called *Markdown*, a markup language that reads like ASCII and can be converted to HTML automatically!