These two methods are different. The first one is declared as a property, so it Contravariance, while the second one Bivariance. For type safety, the first approach is better.
seob.dev
https://seob.dev/posts/%EA%B3%B5%EB%B3%80%EC%84%B1%EC%9D%B4%EB%9E%80-%EB%AC%B4%EC%97%87%EC%9D%B8%EA%B0%80/

Seonglae Cho