[ADD] Test case for GH-796.
[FIX] Take the size of the closure into account when inlining function items.
Merge pull request #797 from LeoWoerteler/gh-796

Fix for GH-796