Use type' instead' of 'return' for getters

For #1450.

Part of #1684.