Skip to content

Commit 80369d7

Browse files
Accept changes which seem fine and likely just caused by evolving libraries
1 parent 14d93eb commit 80369d7

12 files changed

Lines changed: 46 additions & 57 deletions

File tree

Tests/CSharp/ExpressionTests/ExpressionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public void Rounding()
319319
}
320320
}
321321
1 target compilation errors:
322-
CS1503: Argument 1: cannot convert from 'object' to 'double'");
322+
CS1503: Argument 1: cannot convert from 'object' to 'decimal'");
323323
}
324324

325325
[Fact]

Tests/CSharp/ExpressionTests/LinqExpressionTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ Public Shared Sub X(objs As List(Of Object))
388388
Dim MaxObj As Integer = Aggregate o In objs Into Max(o.GetHashCode())
389389
Dim CountWhereObj As Integer = Aggregate o In objs Where o.GetHashCode() > 3 Into Count()
390390
End Sub
391-
End Class", @"using System.Collections.Generic;
391+
End Class", @"using System;
392+
using System.Collections.Generic;
392393
using System.Linq;
393394
394395
public partial class VisualBasicClass
@@ -611,7 +612,8 @@ Sub Foo()
611612
Dim xs As New List(Of String)
612613
Dim y = From x In xs Group By x.Length, x.Count() Into Group
613614
End Sub
614-
End Class", @"using System.Collections.Generic;
615+
End Class", @"using System;
616+
using System.Collections.Generic;
615617
using System.Linq;
616618
617619
public partial class Class1

Tests/CSharp/ExpressionTests/XmlExpressionTests.cs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,22 @@ private void TestMethod()
116116
{
117117
var catalog = new XDocument(
118118
new XElement(""Catalog"",
119-
new XElement(""Book"", new XAttribute(""id"", ""bk101""),
120-
new XElement(""Author"", ""Garghentini, Davide""),
121-
new XElement(""Title"", ""XML Developer's Guide""),
122-
new XElement(""Price"", ""44.95""),
123-
new XElement(""Description"", @""
119+
new XElement(""Book"", new XAttribute(""id"", ""bk101""),
120+
new XElement(""Author"", ""Garghentini, Davide""),
121+
new XElement(""Title"", ""XML Developer's Guide""),
122+
new XElement(""Price"", ""44.95""),
123+
new XElement(""Description"", @""
124124
An in-depth look at creating applications
125125
with "", new XElement(""technology"", ""XML""), @"". For
126126
"", new XElement(""audience"", ""beginners""), @"" or
127127
"", new XElement(""audience"", ""advanced""), @"" developers.
128128
"")
129-
),
130-
new XElement(""Book"", new XAttribute(""id"", ""bk331""),
131-
new XElement(""Author"", ""Spencer, Phil""),
132-
new XElement(""Title"", ""Developing Applications with Visual Basic .NET""),
133-
new XElement(""Price"", ""45.95""),
134-
new XElement(""Description"", @""
129+
),
130+
new XElement(""Book"", new XAttribute(""id"", ""bk331""),
131+
new XElement(""Author"", ""Spencer, Phil""),
132+
new XElement(""Title"", ""Developing Applications with Visual Basic .NET""),
133+
new XElement(""Price"", ""45.95""),
134+
new XElement(""Description"", @""
135135
Get the expert insights, practical code samples,
136136
and best practices you need
137137
to advance your expertise with "", new XElement(""technology"", @""Visual
@@ -140,23 +140,21 @@ and best practices you need
140140
based on professional,
141141
pragmatic guidance by today's top "", new XElement(""audience"", ""developers""), @"".
142142
"")
143-
)
143+
)
144144
)
145145
146146
);
147147
var htmlOutput = new XElement(""html"",
148-
149148
new XElement(""body"", from book in catalog.Elements(""Catalog"").Elements(""Book"")
150149
select new XElement(""div"",
151-
new XElement(""h1"", book.Elements(""Title"").Value),
152-
new XElement(""h3"", ""By "" + book.Elements(""Author"").Value),
153-
new XElement(""h3"", ""Price = "" + book.Elements(""Price"").Value),
154-
150+
new XElement(""h1"", book.Elements(""Title"").Value),
151+
new XElement(""h3"", ""By "" + book.Elements(""Author"").Value),
152+
new XElement(""h3"", ""Price = "" + book.Elements(""Price"").Value),
155153
156154
new XElement(""h2"", ""Description""), TransformDescription((string)book.Elements(""Description"").ElementAtOrDefault(0)), new XElement(""hr"")
157-
)
158-
)
159-
);
155+
)
156+
)
157+
);
160158
}
161159
162160
public string TransformDescription(string s)

Tests/CSharp/MemberTests/MemberTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,7 @@ public async Task FieldWithInstanceOperationOfDifferingTypeAsync()
786786
{
787787
await TestConversionVisualBasicToCSharpAsync(@"Public Class DoesNotNeedConstructor
788788
Private ReadOnly ClassVariable1 As New ParallelOptions With {.MaxDegreeOfParallelism = 5}
789-
End Class", @"using System.Threading.Tasks;
790-
789+
End Class", @"
791790
public partial class DoesNotNeedConstructor
792791
{
793792
private readonly ParallelOptions ClassVariable1 = new ParallelOptions() { MaxDegreeOfParallelism = 5 };
@@ -1154,7 +1153,7 @@ await TestConversionVisualBasicToCSharpAsync(
11541153
@"<DllImport(""kernel32.dll"", SetLastError:=True)>
11551154
Private Shared Function OpenProcess(ByVal dwDesiredAccess As AccessMask, ByVal bInheritHandle As Boolean, ByVal dwProcessId As UInteger) As IntPtr
11561155
End Function", @"[DllImport(""kernel32.dll"", SetLastError = true)]
1157-
private static extern IntPtr OpenProcess(AccessMask dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
1156+
private static extern nint OpenProcess(AccessMask dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
11581157
11591158
1 source compilation errors:
11601159
BC30002: Type 'AccessMask' is not defined.
@@ -1529,7 +1528,7 @@ private void OptionalByRefWithDefault([Optional][DefaultParameterValue(""a"")] r
15291528
BC30455: Argument not specified for parameter 'str2' of 'Private Sub OptionalByRefNoDefault(ByRef str2 As String)'.
15301529
BC30455: Argument not specified for parameter 'str3' of 'Private Sub OptionalByRefWithDefault(ByRef str3 As String)'.
15311530
1 target compilation errors:
1532-
CS7036: There is no argument given that corresponds to the required formal parameter 'str1' of 'MissingByRefArgumentWithNoExplicitDefaultValue.ByRefNoDefault(ref string)'
1531+
CS7036: There is no argument given that corresponds to the required parameter 'str1' of 'MissingByRefArgumentWithNoExplicitDefaultValue.ByRefNoDefault(ref string)'
15331532
");
15341533
}
15351534
}

Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ Sub Foo()
103103
104104
Next
105105
End Sub
106-
End Class", @"
106+
End Class", @"using System.Linq;
107+
107108
public partial class Class1
108109
{
109110
public void Foo()

Tests/CSharp/NamespaceLevelTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ internal partial class test : IComparable
427427
1 source compilation errors:
428428
BC30149: Class 'test' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'.
429429
1 target compilation errors:
430-
CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object)'");
430+
CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object?)'");
431431
}
432432

433433
[Fact]
@@ -444,7 +444,7 @@ internal partial class ClassImplementsInterface2 : IComparable
444444
1 source compilation errors:
445445
BC30149: Class 'ClassImplementsInterface2' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'.
446446
1 target compilation errors:
447-
CS0535: 'ClassImplementsInterface2' does not implement interface member 'IComparable.CompareTo(object)'");
447+
CS0535: 'ClassImplementsInterface2' does not implement interface member 'IComparable.CompareTo(object?)'");
448448
}
449449

450450
[Fact]

Tests/CSharp/StatementTests/MethodStatementTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ internal partial class TestClass
291291
private void TestMethod()
292292
{
293293
string b;
294-
b = new string(""test"".ToCharArray());
294+
b = new string(""test"");
295295
}
296296
}");
297297
}
@@ -325,7 +325,7 @@ internal partial class TestClass
325325
{
326326
private void TestMethod()
327327
{
328-
string b = new string(""test"".ToCharArray());
328+
string b = new string(""test"");
329329
}
330330
}");
331331
}
@@ -342,7 +342,7 @@ internal partial class TestClass
342342
{
343343
private void TestMethod()
344344
{
345-
string b = new string(""test"".ToCharArray());
345+
string b = new string(""test"");
346346
}
347347
}");
348348
}
@@ -608,7 +608,7 @@ public static void Main()
608608
{
609609
y._x = 1;
610610
Console.Write(y._x);
611-
y = (TestWithForEachClass)null;
611+
y = null;
612612
}
613613
}
614614
}

Tests/CSharp/TriviaTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ End Sub
377377
Private ReadOnly ClassVariable1 As New ParallelOptions With {.MaxDegreeOfParallelism = x}
378378
#End Region
379379
End Class
380-
", @"using System.Threading.Tasks;
381-
380+
", @"
382381
public partial class ConversionTest8
383382
{
384383
private int x = 5;

Tests/VB/MemberTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,10 @@ await TestConversionCSharpToVisualBasicAsync(
968968
Private Shared Function OpenProcess(dwDesiredAccess As AccessMask, bInheritHandle As Boolean, dwProcessId As UInteger) As IntPtr
969969
End Function
970970
971-
4 source compilation errors:
971+
3 source compilation errors:
972972
CS0246: The type or namespace name 'AccessMask' could not be found (are you missing a using directive or an assembly reference?)
973973
CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)
974974
CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)
975-
CS0246: The type or namespace name 'SetLastError' could not be found (are you missing a using directive or an assembly reference?)
976975
1 target compilation errors:
977976
BC30002: Type 'AccessMask' is not defined.");
978977
}
@@ -1308,12 +1307,12 @@ End Class
13081307
13091308
15 source compilation errors:
13101309
CS1002: ; expected
1311-
CS0535: 'TestClass' does not implement interface member 'IList.Add(object)'
1312-
CS0535: 'TestClass' does not implement interface member 'IList.Contains(object)'
1310+
CS0535: 'TestClass' does not implement interface member 'IList.Add(object?)'
1311+
CS0535: 'TestClass' does not implement interface member 'IList.Contains(object?)'
13131312
CS0535: 'TestClass' does not implement interface member 'IList.Clear()'
1314-
CS0535: 'TestClass' does not implement interface member 'IList.IndexOf(object)'
1315-
CS0535: 'TestClass' does not implement interface member 'IList.Insert(int, object)'
1316-
CS0535: 'TestClass' does not implement interface member 'IList.Remove(object)'
1313+
CS0535: 'TestClass' does not implement interface member 'IList.IndexOf(object?)'
1314+
CS0535: 'TestClass' does not implement interface member 'IList.Insert(int, object?)'
1315+
CS0535: 'TestClass' does not implement interface member 'IList.Remove(object?)'
13171316
CS0535: 'TestClass' does not implement interface member 'IList.RemoveAt(int)'
13181317
CS0535: 'TestClass' does not implement interface member 'IList.IsReadOnly'
13191318
CS0535: 'TestClass' does not implement interface member 'IList.IsFixedSize'

Tests/VB/NamespaceLevelTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ Implements IComparable
443443
End Class
444444
445445
1 source compilation errors:
446-
CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object)'
446+
CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object?)'
447447
1 target compilation errors:
448448
BC30149: Class 'test' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'.");
449449
}

0 commit comments

Comments
 (0)