Fixes #1871, close implicit objects in implicit returns
Merge pull request #3324 from xixixao/issue1871

Fixes #1871, close implicit objects in implicit returns