  We consider a ${\rm A}_m{\rm B}_n$ diblock copolymer, whose links are capable
of forming local reversible bonds with each other. We assume that the resulting
structure of the bonds is RNA--like, i.e. topologically isomorphic to a tree.
We show that, depending on the relative strengths of A--A, A--B and B--B
contacts, such a polymer can be in one of two different states. Namely, if a
self--association is preferable (i.e., A--A and B--B bonds are comparatively
stronger than A--B contacts) then the polymer forms a typical randomly branched
cloverleaf structure. On the contrary, if alternating association is preferable
(i.e. A--B bonds are stronger than A--A and B--B contacts) then the polymer
tends to form a generally linear necklace structure (with, probably, some rear
side branches and loops, which do not influence the overall characteristics of
the chain). The transition between cloverleaf and necklace states is studied in
details and it is shown that it is a 2nd order phase transition.
