distinctPreviewsByIdSequence

Sequence-shaped variant of distinctPreviewsById used by the compiler plugin's collectAllModulePreviews() IR rewrite. Walks previews once, yields each first occurrence by CollectedPreview.id in encounter order, and on the final next() == null step emits one warnDuplicatePreview line per id that collided two-or-more times.

The behavior matches distinctPreviewsById except the fold is lazy: an early-exit consumer (previews.firstOrNull { ... }, previews.take(2)) only iterates the prefix it needs, and dup detection runs only over that prefix. A consumer that drains the sequence via previews.toList() sees the full warning set, identical to the pre-laziness behavior — and uses the per-platform warnDuplicatePreview routing (System.err on JVM, Log.w on Android, NSLog on iOS, console.warn on JS / Wasm JS) with the shared WarnPrefix prepended.

Internal API — meant only as a callsite for the compiler plugin.