A study was carried out on the nucleophilic cyclotransformation of pyrrolo[1,2-a]pyrazinium salts and isoquinolinium salts containing a methyl group in the α-position. A method for the preparation of alkylaminotetrahydroindolizinones and tetralones was proposed.