fix Issue 13550 - Inner functions take outer function attributes erroneously
Merge pull request #4031 from 9rnsr/fix13550

[REG2.067a] Issue 13550 - Inner functions take outer function attributes erroneously