fix Issue 9790 - Internal error when compiling a invalid variable in template

1. Remove gagging in VarDeclaration::semantic
2. Commit type in StructLiteralExp::castTo like as StringExp and NullExp
   It's necessary to avoid std.traits unittest breaking.
fix Issue 9818 - Constant folding for static array does not work with initializing by element

Refactoring code for initializer semantic.

- Handle implicit constructor call in ExpInitializer::semantic
- Add target type parameter in Initializer::toExpression.
  For `T[n] sa = e;`, its initializer translation to [e1, e2, ..., en] is delayed until it's really needed.
Merge pull request #1801 from 9rnsr/fix9818

Issue 9818 - Constant folding for static array does not work with initializing by element