fix Issue 6905 - ref acts as auto ref when return type is missing
Merge pull request #1401 from 9rnsr/fix6905

Issue 6905 - ref acts as auto ref when return type is missing