diff --git a/mcs/mcs/convert.cs b/mcs/mcs/convert.cs index a11d8b6c8269447343521521eaf6dd1a46a33d08..33a16119605892c36b6bc6fc6a8d266049bcf6b0 100644 --- a/mcs/mcs/convert.cs +++ b/mcs/mcs/convert.cs @@ -1375,8 +1375,12 @@ namespace Mono.CSharp { if (expr_type == InternalType.Arglist && target_type == TypeManager.arg_iterator_type) return expr; - if (TypeSpecComparer.IsEqual (expr_type, target_type)) - return expr; + if (TypeSpecComparer.IsEqual (expr_type, target_type)) { + if (expr_type == target_type) + return expr; + + return EmptyCast.Create (expr, target_type); + } return null; }