KT-3308: Support local generic functions in codegen

 #KT-3308 Fixed