; Fieldtest — canonical-type-names, axis 3: QualifiedClassName.
;
; A consumer defines a local Box type and writes an instance for
; `prelude.Eq` instead of bare `Eq`. Per ct.1's load-time validator,
; class names are NOT module-scoped (they remain workspace-flat,
; with MethodNameCollision enforcing uniqueness), so a qualified
; class name in an InstanceDef.class field is a schema violation.

(module ct_4_qualified_class

  (data Box
    (doc "A trivial Int wrapper.")
    (ctor MkBox (con Int)))

  (instance
    (class prelude.Eq)
    (type (con Box))
    (method eq
      (body
        (lam (params (typed x (con Box)) (typed y (con Box))) (ret (con Bool))
          (body
            (match x
              (case (pat-ctor MkBox a)
                (match y
                  (case (pat-ctor MkBox b)
                    (app eq a b)))))))))))
