Somehow related to Issue 14740.
The problem is that MyClass is inside a function, and therefore will get a additional "this" member. The "this" member is inaccsessible, so if the library tries to search attribtues it will fail at this "this" member.
Comment #2 by github-bugzilla — 2016-08-30T11:13:35Z