Skip to content

Commit c623129

Browse files
Innocuous looking recharacterization (note that the library will always have done this stuff in VS 16.10)
1 parent 687d36c commit c623129

File tree

39 files changed

+179
-248
lines changed

39 files changed

+179
-248
lines changed

Tests/CSharp/ExpressionTests/BinaryExpressionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private void TestMethod()
116116
x += 1d;
117117
x -= 2d;
118118
x *= 3d;
119-
x = x / 4L;
119+
x = (double)(x / 4L);
120120
x = Math.Pow(x, 5d);
121121
}
122122
}");

Tests/CSharp/ExpressionTests/ExpressionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ private partial class Rec
10611061
10621062
private Rec TestMethod(string str)
10631063
{
1064-
int length = str?.Length ?? -1;
1064+
int length = (str?.Length) ?? -1;
10651065
Console.WriteLine(length);
10661066
Console.ReadKey();
10671067
return new Rec()?.Prop?.Prop?.Prop;

Tests/CSharp/MemberTests/MemberTests.cs

Lines changed: 32 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,7 @@ public virtual int RenamedReadOnlyProperty
582582
}
583583
}
584584
585-
int IClass.ReadOnlyProp // Comment moves because this line gets split
586-
{
587-
get => RenamedReadOnlyProperty;
588-
}
585+
int IClass.ReadOnlyProp { get => RenamedReadOnlyProperty; } // Comment moves because this line gets split
589586
590587
public virtual int get_RenamedWriteOnlyPropParam(int i)
591588
{
@@ -610,10 +607,7 @@ public virtual int RenamedWriteOnlyProperty
610607
}
611608
}
612609
613-
int IClass.WriteOnlyProp // Comment moves because this line gets split
614-
{
615-
set => RenamedWriteOnlyProperty = value;
616-
}
610+
int IClass.WriteOnlyProp { set => RenamedWriteOnlyProperty = value; } // Comment moves because this line gets split
617611
}");
618612
}
619613

@@ -1896,11 +1890,7 @@ private int doFoo()
18961890
int IFoo.DoFoo() => doFoo();
18971891
18981892
private int prop { get; set; }
1899-
int IFoo.Prop
1900-
{
1901-
get => prop;
1902-
set => prop = value;
1903-
}
1893+
int IFoo.Prop { get => prop; set => prop = value; }
19041894
19051895
private int Consumer()
19061896
{
@@ -1971,11 +1961,7 @@ protected internal virtual int doFoo()
19711961
int IFoo.DoFoo() => doFoo();
19721962
19731963
protected internal virtual int prop { get; set; }
1974-
int IFoo.Prop
1975-
{
1976-
get => prop;
1977-
set => prop = value;
1978-
}
1964+
int IFoo.Prop { get => prop; set => prop = value; }
19791965
}
19801966
19811967
public partial class Foo : BaseFoo
@@ -2053,10 +2039,7 @@ public partial interface IFoo
20532039
public abstract partial class BaseFoo : IUserContext
20542040
{
20552041
protected internal string ConnectedGroupID { get; private set; }
2056-
string IUserContext.GroupID
2057-
{
2058-
get => ConnectedGroupID;
2059-
}
2042+
string IUserContext.GroupID { get => ConnectedGroupID; }
20602043
}
20612044
20622045
public partial class Foo : BaseFoo, IFoo
@@ -2069,10 +2052,7 @@ public partial class Foo : BaseFoo, IFoo
20692052
}
20702053
}
20712054
2072-
string IFoo.ConnectedGroupId // Comment moves because this line gets split
2073-
{
2074-
get => ConnectedGroupID;
2075-
}
2055+
string IFoo.ConnectedGroupId { get => ConnectedGroupID; } // Comment moves because this line gets split
20762056
20772057
private string Consumer()
20782058
{
@@ -2161,17 +2141,9 @@ public partial interface IBar
21612141
public partial class FooBar : IFoo, IBar
21622142
{
21632143
public int Foo { get; set; }
2164-
int IFoo.FooBarProp
2165-
{
2166-
get => Foo;
2167-
set => Foo = value;
2168-
}
2144+
int IFoo.FooBarProp { get => Foo; set => Foo = value; }
21692145
public int Bar { get; set; }
2170-
int IBar.FooBarProp
2171-
{
2172-
get => Bar;
2173-
set => Bar = value;
2174-
}
2146+
int IBar.FooBarProp { get => Bar; set => Bar = value; }
21752147
}");
21762148
}
21772149

@@ -2236,11 +2208,7 @@ public partial interface IFoo
22362208
public partial class Foo : TestNamespace.IFoo
22372209
{
22382210
public int FooPropRenamed { get; set; }
2239-
int TestNamespace.IFoo.FooProp
2240-
{
2241-
get => FooPropRenamed;
2242-
set => FooPropRenamed = value;
2243-
}
2211+
int TestNamespace.IFoo.FooProp { get => FooPropRenamed; set => FooPropRenamed = value; }
22442212
}");
22452213
}
22462214

@@ -2321,11 +2289,7 @@ public partial interface IFoo
23212289
public partial class Foo : IFoo
23222290
{
23232291
public int FooPropRenamed { get; set; }
2324-
int IFoo.FooProp
2325-
{
2326-
get => FooPropRenamed;
2327-
set => FooPropRenamed = value;
2328-
}
2292+
int IFoo.FooProp { get => FooPropRenamed; set => FooPropRenamed = value; }
23292293
}
23302294
23312295
public partial class FooConsumer
@@ -2504,11 +2468,7 @@ public partial interface IFoo
25042468
public partial class Foo : IFoo
25052469
{
25062470
public int FooPropRenamed { get; set; }
2507-
int IFoo.FooProp
2508-
{
2509-
get => FooPropRenamed;
2510-
set => FooPropRenamed = value;
2511-
}
2471+
int IFoo.FooProp { get => FooPropRenamed; set => FooPropRenamed = value; }
25122472
}
25132473
25142474
public partial class FooConsumer
@@ -2599,11 +2559,7 @@ public partial interface IFoo
25992559
public partial class Foo : IFoo
26002560
{
26012561
public int FooPropRenamed { get; set; }
2602-
int IFoo.FooProp
2603-
{
2604-
get => FooPropRenamed;
2605-
set => FooPropRenamed = value;
2606-
}
2562+
int IFoo.FooProp { get => FooPropRenamed; set => FooPropRenamed = value; }
26072563
}
26082564
26092565
public partial class FooConsumer
@@ -2701,10 +2657,7 @@ public int MyClassDoFooRenamed
27012657
}
27022658
}
27032659
2704-
int IFoo.DoFoo
2705-
{
2706-
get => DoFooRenamed;
2707-
}
2660+
int IFoo.DoFoo { get => DoFooRenamed; }
27082661
27092662
public virtual int DoFooRenamed // Comment ends up out of order, but attached to correct method
27102663
{
@@ -2722,10 +2675,7 @@ public int MyClassDoBarRenamed
27222675
}
27232676
}
27242677
2725-
int IFoo.DoBar
2726-
{
2727-
set => DoBarRenamed = value;
2728-
}
2678+
int IFoo.DoBar { set => DoBarRenamed = value; }
27292679
27302680
public virtual int DoBarRenamed // Comment ends up out of order, but attached to correct method
27312681
{
@@ -2889,16 +2839,8 @@ public partial interface IBar
28892839
public partial class Foo : IFoo, IBar
28902840
{
28912841
private int ExplicitProp { get; set; }
2892-
int IFoo.ExplicitProp
2893-
{
2894-
get => ExplicitProp;
2895-
set => ExplicitProp = value;
2896-
}
2897-
int IBar.ExplicitProp
2898-
{
2899-
get => ExplicitProp;
2900-
set => ExplicitProp = value;
2901-
}
2842+
int IFoo.ExplicitProp { get => ExplicitProp; set => ExplicitProp = value; }
2843+
int IBar.ExplicitProp { get => ExplicitProp; set => ExplicitProp = value; }
29022844
}");
29032845
}
29042846

@@ -2933,17 +2875,9 @@ public partial interface IBar
29332875
public abstract partial class Foo : IFoo, IBar
29342876
{
29352877
protected abstract int ExplicitPropRenamed1 { get; set; }
2936-
int IFoo.ExplicitProp
2937-
{
2938-
get => ExplicitPropRenamed1;
2939-
set => ExplicitPropRenamed1 = value;
2940-
}
2878+
int IFoo.ExplicitProp { get => ExplicitPropRenamed1; set => ExplicitPropRenamed1 = value; }
29412879
protected abstract int ExplicitPropRenamed2 { get; set; }
2942-
int IBar.ExplicitProp
2943-
{
2944-
get => ExplicitPropRenamed2;
2945-
set => ExplicitPropRenamed2 = value;
2946-
}
2880+
int IBar.ExplicitProp { get => ExplicitPropRenamed2; set => ExplicitPropRenamed2 = value; }
29472881
}");
29482882
}
29492883

@@ -2999,11 +2933,7 @@ protected override void OnSave()
29992933
void IFoo.Save() => OnSave();
30002934
30012935
protected override int MyProp { get; set; } = 6;
3002-
int IFoo.Prop
3003-
{
3004-
get => MyProp;
3005-
set => MyProp = value;
3006-
}
2936+
int IFoo.Prop { get => MyProp; set => MyProp = value; }
30072937
}");
30082938
}
30092939

@@ -3055,16 +2985,8 @@ public virtual void Save()
30552985
void IBar.OnSave() => Save();
30562986
30572987
public virtual int A { get; set; }
3058-
int IFoo.A
3059-
{
3060-
get => A;
3061-
set => A = value;
3062-
}
3063-
int IBar.B
3064-
{
3065-
get => A;
3066-
set => A = value;
3067-
}
2988+
int IFoo.A { get => A; set => A = value; }
2989+
int IBar.B { get => A; set => A = value; }
30682990
}");
30692991
}
30702992

@@ -3120,11 +3042,7 @@ public partial class Foo : BaseFoo, IFoo
31203042
void IFoo.Save() => OnSave();
31213043
31223044
public new int MyProp { get; set; } = 6;
3123-
int IFoo.Prop
3124-
{
3125-
get => MyProp;
3126-
set => MyProp = value;
3127-
}
3045+
int IFoo.Prop { get => MyProp; set => MyProp = value; }
31283046
}");
31293047
}
31303048

@@ -3175,16 +3093,8 @@ private int ExplicitProp
31753093
}
31763094
}
31773095
3178-
int IFoo.ExplicitProp
3179-
{
3180-
get => ExplicitProp;
3181-
set => ExplicitProp = value;
3182-
}
3183-
int IBar.ExplicitProp // Comment moves because this line gets split
3184-
{
3185-
get => ExplicitProp;
3186-
set => ExplicitProp = value;
3187-
}
3096+
int IFoo.ExplicitProp { get => ExplicitProp; set => ExplicitProp = value; }
3097+
int IBar.ExplicitProp { get => ExplicitProp; set => ExplicitProp = value; } // Comment moves because this line gets split
31883098
}");
31893099
}
31903100

@@ -3275,16 +3185,8 @@ internal virtual int FriendProp
32753185
}
32763186
}
32773187
3278-
int IFoo.FriendProp
3279-
{
3280-
get => FriendProp;
3281-
set => FriendProp = value;
3282-
}
3283-
int IBar.FriendProp // Comment moves because this line gets split
3284-
{
3285-
get => FriendProp;
3286-
set => FriendProp = value;
3287-
}
3188+
int IFoo.FriendProp { get => FriendProp; set => FriendProp = value; }
3189+
int IBar.FriendProp { get => FriendProp; set => FriendProp = value; } // Comment moves because this line gets split
32883190
32893191
protected void ProtectedSub()
32903192
{
@@ -3355,16 +3257,9 @@ public partial interface IFoo
33553257
public partial class Foo : IFoo
33563258
{
33573259
public int ExplicitPropRenamed { get; set; }
3358-
int IFoo.ExplicitProp
3359-
{
3360-
get => ExplicitPropRenamed;
3361-
set => ExplicitPropRenamed = value;
3362-
}
3260+
int IFoo.ExplicitProp { get => ExplicitPropRenamed; set => ExplicitPropRenamed = value; }
33633261
public int ExplicitRenamedReadOnlyProp { get; private set; }
3364-
int IFoo.ExplicitReadOnlyProp
3365-
{
3366-
get => ExplicitRenamedReadOnlyProp;
3367-
}
3262+
int IFoo.ExplicitReadOnlyProp { get => ExplicitRenamedReadOnlyProp; }
33683263
33693264
private void Consumer()
33703265
{
@@ -3404,14 +3299,8 @@ public partial interface IBar
34043299
public partial class Foo : IFoo, IBar
34053300
{
34063301
public int ExplicitPropRenamed { get; private set; }
3407-
int IFoo.ExplicitProp
3408-
{
3409-
get => ExplicitPropRenamed;
3410-
}
3411-
int IBar.ExplicitProp
3412-
{
3413-
get => ExplicitPropRenamed;
3414-
}
3302+
int IFoo.ExplicitProp { get => ExplicitPropRenamed; }
3303+
int IBar.ExplicitProp { get => ExplicitPropRenamed; }
34153304
}");
34163305
}
34173306

@@ -3454,14 +3343,8 @@ public int ExplicitPropRenamed
34543343
}
34553344
}
34563345
3457-
int IFoo.ExplicitProp
3458-
{
3459-
set => ExplicitPropRenamed = value;
3460-
}
3461-
int IBar.ExplicitProp // Comment moves because this line gets split
3462-
{
3463-
set => ExplicitPropRenamed = value;
3464-
}
3346+
int IFoo.ExplicitProp { set => ExplicitPropRenamed = value; }
3347+
int IBar.ExplicitProp { set => ExplicitPropRenamed = value; } // Comment moves because this line gets split
34653348
}");
34663349
}
34673350

Tests/CSharp/StatementTests/LoopStatementTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ internal partial class ForEnumAsync
196196
{
197197
public void PrintLoop(MyEnum startIndex, MyEnum endIndex, MyEnum step)
198198
{
199-
for (MyEnum i = startIndex, loopTo = endIndex; step >= 0 ? i <= loopTo : i >= loopTo; i += (int)step)
199+
for (MyEnum i = startIndex, loopTo = endIndex; (int)step >= 0 ? i <= loopTo : i >= loopTo; i += (int)step)
200200
Debug.WriteLine(i);
201-
for (MyEnum i2 = startIndex, loopTo1 = endIndex; step >= 0 ? i2 <= loopTo1 : i2 >= loopTo1; i2 += (int)step)
201+
for (MyEnum i2 = startIndex, loopTo1 = endIndex; (int)step >= 0 ? i2 <= loopTo1 : i2 >= loopTo1; i2 += (int)step)
202202
Debug.WriteLine(i2);
203203
for (MyEnum i3 = startIndex, loopTo2 = endIndex; i3 <= loopTo2; i3 += 3)
204204
Debug.WriteLine(i3);

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/AnotherSharedNamespaceClass.vb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Namespace NamespaceSharedWithOtherAssembly
23
Friend Class AnotherSharedNamespaceClass
34
End Class

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Imports System.Reflection
22
Imports System.Runtime.InteropServices
33

4-
54
' General Information about an assembly is controlled through the following
65
' set of attributes. Change these attribute values to modify the information
76
' associated with an assembly.

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CSharpNetStandardLib/Class1.vb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Namespace CSharpNetStandardLib
23
Public Class Class1
34
Public Sub MethodOnlyDifferingInTypeParameterCount()

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/AnotherSharedNamespaceClass.vb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Namespace NamespaceSharedWithOtherAssembly
23
Friend Class AnotherSharedNamespaceClass
34
End Class

0 commit comments

Comments
 (0)