^KT-59425 Fixed ^KT-59370 Fixed
Order is following: - declared declarations in declaration (in source) order - generated declarations in sorted order