Stereochemistry as a tool in deciphering the processes of a tandem iminium cyclization and Smiles rearrangement.