{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/solidity/issues/5345","repository_url":"https://api.github.com/repos/ethereum/solidity","labels_url":"https://api.github.com/repos/ethereum/solidity/issues/5345/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/5345/comments","events_url":"https://api.github.com/repos/ethereum/solidity/issues/5345/events","html_url":"https://github.com/ethereum/solidity/issues/5345","id":377228247,"node_id":"MDU6SXNzdWUzNzcyMjgyNDc=","number":5345,"title":"Need more precise descriptions about supporting inheritance in Solidity","user":{"login":"SunBeomSo","id":13723704,"node_id":"MDQ6VXNlcjEzNzIzNzA0","avatar_url":"https://avatars0.githubusercontent.com/u/13723704?v=4","gravatar_id":"","url":"https://api.github.com/users/SunBeomSo","html_url":"https://github.com/SunBeomSo","followers_url":"https://api.github.com/users/SunBeomSo/followers","following_url":"https://api.github.com/users/SunBeomSo/following{/other_user}","gists_url":"https://api.github.com/users/SunBeomSo/gists{/gist_id}","starred_url":"https://api.github.com/users/SunBeomSo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunBeomSo/subscriptions","organizations_url":"https://api.github.com/users/SunBeomSo/orgs","repos_url":"https://api.github.com/users/SunBeomSo/repos","events_url":"https://api.github.com/users/SunBeomSo/events{/privacy}","received_events_url":"https://api.github.com/users/SunBeomSo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-05T02:28:03Z","updated_at":"2018-11-29T12:35:11Z","closed_at":null,"author_association":"NONE","body":"I wonder the exact mechanism of copying code that involves \"super\" keyword for supporting inheritance in Solidity.\r\n\r\nI think clarification of this potentially helps the formal verification community.\r\n\r\nBelow is an example code that elaborates my question.\r\n\r\n    contract C { \r\n        function test() public {  } \r\n    }\r\n\r\n    contract B is C {\r\n        function bbb() public {  }\r\n        function test() public {\r\n           bbb(); \r\n           super.test(); \r\n        }\r\n    } \r\n\r\n    contract A is B {\r\n    }\r\n\r\n\r\nIf we deploy the contract ```A``` and calls the function ```A.test()```, then the actual (and desirable) effect is a call sequence of ```bbb()->C.test()``` (where super is replaced with C).\r\n\r\nHowever, _literally_ following the below explanation on inheritance in Solidity docs\r\n> the code from all the base contracts is copied into the created contract.\r\n\r\nmay produce undesirable behaviors.\r\nFor clarification, let me perform the copy process for the example code above:\r\n\r\n    contract C { \r\n        function test() public {  } \r\n    }\r\n\r\n    contract B is C {\r\n        function bbb() public {  }\r\n        function test() public {\r\n           bbb(); \r\n           super.test(); \r\n        }\r\n    } \r\n\r\n    contract A is B {\r\n        function bbb() public {  }\r\n        function test() public {\r\n           bbb(); \r\n           super.test(); \r\n        }\r\n    }\r\n\r\nAgain, if we deploy ```A``` and calls ```A.test()```, then we have a call sequence of ```bbb() -> B.test() -> bbb() -> C.test() ```, where the ```super```s in ```A``` and ```B``` are replaced by ```B``` and ```C```, respectively.\r\n\r\nDo I have any missing point?"},"comment":{"url":"https://api.github.com/repos/ethereum/solidity/issues/comments/442818003","html_url":"https://github.com/ethereum/solidity/issues/5345#issuecomment-442818003","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/5345","id":442818003,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjgxODAwMw==","user":{"login":"chriseth","id":9073706,"node_id":"MDQ6VXNlcjkwNzM3MDY=","avatar_url":"https://avatars2.githubusercontent.com/u/9073706?v=4","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"created_at":"2018-11-29T12:35:11Z","updated_at":"2018-11-29T12:35:11Z","author_association":"CONTRIBUTOR","body":"@SunBeomSo would https://github.com/ethereum/solidity/pull/5541increase the understanding? I know it does not add an example, but since the operation cannot be represented as an operation on source code, it is hard to provide an example."}}
{"actor":{"display_login":"chriseth"}}