As @stof pointed out, a return type may only be changed to "compatible" types. I don't know yet how to define "compatible types" though.