{"action":"opened","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4250","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4250/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4250/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4250/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/4250","id":79963280,"number":4250,"title":"Structural sub-typing type hole","user":{"login":"Simn","id":634365,"avatar_url":"https://avatars.githubusercontent.com/u/634365?v=3","gravatar_id":"","url":"https://api.github.com/users/Simn","html_url":"https://github.com/Simn","followers_url":"https://api.github.com/users/Simn/followers","following_url":"https://api.github.com/users/Simn/following{/other_user}","gists_url":"https://api.github.com/users/Simn/gists{/gist_id}","starred_url":"https://api.github.com/users/Simn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simn/subscriptions","organizations_url":"https://api.github.com/users/Simn/orgs","repos_url":"https://api.github.com/users/Simn/repos","events_url":"https://api.github.com/users/Simn/events{/privacy}","received_events_url":"https://api.github.com/users/Simn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-23T21:52:40Z","updated_at":"2015-05-23T21:52:40Z","closed_at":null,"body":"```\r\ntypedef Node = { parent: Node };\r\n\r\nclass SomeNode {\r\n\tpublic var parent:SomeNode;\r\n\tpublic function new() { }\r\n}\r\n\r\nclass Main {\r\n\tstatic function main() {\r\n\t\tvar someNode = new SomeNode();\r\n\t\tvar n:Node = someNode;\r\n\t\tn.parent = { parent: null };\r\n\t}\r\n}\r\n```\r\n\r\nI was surprised to find that the `var n:Node = someNode` assignment is allowed. It allows writing a different type to the `parent` class field which then causes trouble if accessed via the original type. Consequentially this fails on e.g. flash with `Type Coercion failed: cannot convert Object@64d7299 to SomeNode`."}}