You absolutely do not need a computer telling you what types you can put in a collection. Put an assert, write some unit tests, if you aren’t sure where data sources come from and can’t write a one-line comment.
Dynamic typing makes you fast, it’s empowering. Try it and quit being so scared.