Fix the condition for qualifying the symbol of methods and functions in the enclosing declaration

Fixes #604
Merge pull request #638 from Microsoft/qualificationOfMethods

Fix the condition for qualifying the symbol of methods and functions in the enclosing declaration