[T-3250] [FIX] Prevent check for ret type before ret is defined

Merged Facundo Barral requested to merge T3250 into 15.0-preStable

Merge request reports