compiler: Fix polymorphic resolution corner cases

Fix crashes in ResolveTypeVars in the following cases:

- Resolving anything with (U) as the polymorphic type

- Resolving uniform or specific vectors with an empty vector as the
  evidence type
compiler: Simplify )typed-dynamic)

Instead of casting the value to <any> and then doing a runtime cast back
to the desired type create a mutable with the target type and set it
twice. This avoids having to generate a runtime type check for the type.