There is assumeUnique which effectively does cast to immutable but is more clear to the reader in a sense why breaking type system was considered legit. I recommend using it over raw cast.