LOOM-LSGEN: Fix member implicit typing failure when member var is declared after a function where that member is used, with unit test