Copy getters and setters from parent into child when extending

Fixes #3536.