Heterocyclic polymers have gained enormous attention for their unique functionalities and wide applications. In contrast with the well-studied polymer systems with five- or six-membered heterocycles, functional polymers with readily openable small-ring heterocycles have rarely been explored due to their large synthetic difficulty. Herein, a facile one-pot multicomponent polymerization to such polymers is developed. A series of functional polymers with multisubstituted and heteroatom-rich azetidine frameworks are efficiently generated at room temperature in high atom economy from handy monomers. The four-membered azetidine rings in the polymer skeletons can be easily transformed into amide and amidine moieties via a fast and efficient acid-mediated ring-opening reaction, producing brand-new polymeric materials with distinctive properties. All the as-prepared azetidine-containing polymers exhibit intrinsic visible luminescence in the solid state under long-wavelength UV irradiation even without conventionally conjugated structures. Such unconventional luminescence is attributed to the clusteroluminogens formed by through-space electronic interactions of heteroatoms and phenyl rings. All the obtained polymers show excellent optical transparency, high and tunable refractive indices, low optical dispersions and good photopatternability, which make them promising materials in various advanced electronic and optoelectronic devices. The ring-opened polymers can also function as a lysosome-specific fluorescent probe in biological imaging.