Scala is more strict than Typescript, and sometimes a cast is the best solution.
This exists to make casts safer, since it only casts the type parameters