private EXPR CreateLocal(Type type, bool bIsOut, LocalVariableSymbol local)
{
CType ctype = _symbolTable.GetCTypeFromType(type);
if (bIsOut)
{
Debug.Assert(ctype.IsParameterModifierType());
ctype = _semanticChecker.GetTypeManager().GetParameterModifier(
ctype.AsParameterModifierType().GetParameterType(),
true);
}
// If we can convert, do that. If not, cast it.
EXPRLOCAL exprLocal = _exprFactory.CreateLocal(EXPRFLAG.EXF_LVALUE, local);
EXPR result = _binder.tryConvert(exprLocal, ctype);
if (result == null)
{
result = _binder.mustCast(exprLocal, ctype);
}
result.flags |= EXPRFLAG.EXF_LVALUE;
return result;
}