{"action":"closed","issue":{"url":"https://api.github.com/repos/perl6/doc/issues/1459","repository_url":"https://api.github.com/repos/perl6/doc","labels_url":"https://api.github.com/repos/perl6/doc/issues/1459/labels{/name}","comments_url":"https://api.github.com/repos/perl6/doc/issues/1459/comments","events_url":"https://api.github.com/repos/perl6/doc/issues/1459/events","html_url":"https://github.com/perl6/doc/issues/1459","id":251424552,"number":1459,"title":"/language/objects wrongly claims that `self` is a type object inside `submethod BUILD`","user":{"login":"smls","id":3093580,"avatar_url":"https://avatars0.githubusercontent.com/u/3093580?v=4","gravatar_id":"","url":"https://api.github.com/users/smls","html_url":"https://github.com/smls","followers_url":"https://api.github.com/users/smls/followers","following_url":"https://api.github.com/users/smls/following{/other_user}","gists_url":"https://api.github.com/users/smls/gists{/gist_id}","starred_url":"https://api.github.com/users/smls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smls/subscriptions","organizations_url":"https://api.github.com/users/smls/orgs","repos_url":"https://api.github.com/users/smls/repos","events_url":"https://api.github.com/users/smls/events{/privacy}","received_events_url":"https://api.github.com/users/smls/received_events","type":"User","site_admin":false},"labels":[{"id":244843225,"url":"https://api.github.com/repos/perl6/doc/labels/docs","name":"docs","color":"5DE0FA","default":false},{"id":676800676,"url":"https://api.github.com/repos/perl6/doc/labels/update","name":"update","color":"5DE0FA","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-19T13:17:43Z","updated_at":"2017-08-31T19:33:48Z","closed_at":"2017-08-31T19:33:48Z","author_association":"CONTRIBUTOR","body":"from [/language/objects#self](https://docs.perl6.org/language/objects#self):\r\n\r\n> Since user defined constructors are called on type objects, self will point to the type object in constructors and the submethod BUILD. Initializers are also called before object construction time. This can be used to access class attributes in initializers.\r\n\r\nThis is not actually the case. `self` is not a type object there, it is a **partially constructed object** which counts as `.defined`:\r\n\r\n``` Perl 6\r\nclass A {\r\n    submethod BUILD { say self.defined; }\r\n}\r\nA.new;  # True\r\n```\r\n\r\nIndeed, virtual method calls with the `self.foo` syntax work there.  \r\n(The `$.foo` method call syntax doesn't, [to protect users from writing buggy code](https://irclog.perlgeek.de/perl6/2017-08-19#i_15042309).)"}}
{"actor":{"display_login":"moritz"}}