; Minimal repro of the same-module type-scoped call bug.
; Calling `(app Counter.value c)` from within Counter's home
; module raises [type-mismatch] expected `kem_2b_min_repro.Counter`,
; got `Counter` — even though `value` belongs to *this* module.
; Switching to bare `(app value c)` works.

(module kem_2b_min_repro

  (data Counter
    (ctor MkCounter (con Int)))

  (fn value
    (type (fn-type (params (borrow (con Counter))) (ret (own (con Int)))))
    (params c)
    (body (match c (case (pat-ctor MkCounter x) x))))

  (fn main
    (type (fn-type (params) (ret (own (con Unit))) (effects IO)))
    (params)
    (body
      (let c (term-ctor Counter MkCounter 41)
        (app print (app Counter.value c))))))
