fix Issue 11785 - Order of method/function declarations has an effect on compilation result
Merge pull request #2993 from 9rnsr/fix11785

Issue 11785 - Order of method/function declarations has an effect on compilation result