Skip to content

Commit 47f0b1f

Browse files
Make results closer match for existing
1 parent 80369d7 commit 47f0b1f

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

CodeConverter/CSharp/TypeConversionAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ private static TypeConversionKind AnalyzeVbConversion(bool alwaysExplicit, IType
378378
return TypeConversionKind.EnumConversionThenCast;
379379
}
380380
if (vbConversion.IsNarrowing) {
381-
return TypeConversionKind.DestructiveCast;
381+
return vbConversion.IsTypeParameter ? TypeConversionKind.Conversion : TypeConversionKind.DestructiveCast;
382382
}
383383
if (alwaysExplicit) {
384384
return TypeConversionKind.NonDestructiveCast;

CodeConverter/Common/DefaultReferences.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.Linq;
66
using System.Reflection;
7+
using System.Threading.Tasks;
78
using Microsoft.CodeAnalysis;
89

910
namespace ICSharpCode.CodeConverter.Common;
@@ -17,8 +18,8 @@ public static class DefaultReferences
1718
// ReSharper disable RedundantNameQualifier
1819
typeof(System.Object),
1920
typeof(System.Collections.IEnumerable),
20-
typeof(IEnumerable<>),
21-
typeof(ErrorEventArgs),
21+
typeof(System.Collections.Generic.IEnumerable<>),
22+
typeof(System.IO.ErrorEventArgs),
2223
typeof(System.Text.Encoding),
2324
typeof(System.Linq.Enumerable),
2425
typeof(System.Console),
@@ -32,7 +33,8 @@ public static class DefaultReferences
3233
typeof(System.Xml.Linq.XElement),
3334
typeof(System.Linq.Expressions.Expression),
3435
typeof(Microsoft.VisualBasic.Constants),
35-
typeof(System.Data.SqlClient.SqlCommand)
36+
typeof(System.Data.SqlClient.SqlCommand),
37+
typeof(System.Threading.Tasks.ParallelOptions)
3638
// ReSharper restore RedundantNameQualifier
3739
}.Select(t => t.Assembly).Concat(
3840
new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") }

0 commit comments

Comments
 (0)