Skip to content

Commit 25d5b39

Browse files
committed
Swap old custom baked ExpressionVisitor with System.Linq.Expressions.ExpressionVisitor
Closes #1089
1 parent 57bb293 commit 25d5b39

File tree

10 files changed

+3543
-612
lines changed

10 files changed

+3543
-612
lines changed

Diff for: src/Benchmarking/project.lock.json

+99-15
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@
508508
"frameworkAssemblies": [
509509
"System.Diagnostics.Tools",
510510
"System.IO.Compression.FileSystem",
511+
"System.Linq",
511512
"System.Reflection",
512513
"System.Runtime",
513514
"System.Threading.Tasks"
@@ -1032,6 +1033,7 @@
10321033
"System.Diagnostics.Tools": "4.0.1-beta-23225",
10331034
"System.Dynamic.Runtime": "4.0.11-beta-23516",
10341035
"System.Linq": "4.0.0-beta-23109",
1036+
"System.Linq.Expressions": "4.0.11-beta-23516",
10351037
"System.Linq.Queryable": "4.0.0-beta-23109",
10361038
"System.Runtime": "4.0.21-beta-23225",
10371039
"System.Threading": "4.0.11-beta-23225",
@@ -2716,6 +2718,7 @@
27162718
"frameworkAssemblies": [
27172719
"System.Diagnostics.Tools",
27182720
"System.IO.Compression.FileSystem",
2721+
"System.Linq",
27192722
"System.Reflection",
27202723
"System.Runtime",
27212724
"System.Threading.Tasks"
@@ -3337,6 +3340,7 @@
33373340
"frameworkAssemblies": [
33383341
"System.Diagnostics.Tools",
33393342
"System.IO.Compression.FileSystem",
3343+
"System.Linq",
33403344
"System.Reflection",
33413345
"System.Runtime",
33423346
"System.Threading.Tasks"
@@ -3879,6 +3883,7 @@
38793883
"System.Diagnostics.Tools": "4.0.1-beta-23225",
38803884
"System.Dynamic.Runtime": "4.0.11-beta-23516",
38813885
"System.Linq": "4.0.0-beta-23109",
3886+
"System.Linq.Expressions": "4.0.11-beta-23516",
38823887
"System.Linq.Queryable": "4.0.0-beta-23109",
38833888
"System.Runtime": "4.0.21-beta-23225",
38843889
"System.Threading": "4.0.11-beta-23225",
@@ -3894,6 +3899,34 @@
38943899
"lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
38953900
}
38963901
},
3902+
"runtime.any.System.Linq.Expressions/4.0.11-beta-23516": {
3903+
"type": "package",
3904+
"dependencies": {
3905+
"System.Collections": "4.0.10",
3906+
"System.Diagnostics.Debug": "4.0.10",
3907+
"System.Globalization": "4.0.10",
3908+
"System.IO": "4.0.10",
3909+
"System.Linq": "4.0.0",
3910+
"System.ObjectModel": "4.0.10",
3911+
"System.Reflection": "4.0.10",
3912+
"System.Reflection.Emit": "4.0.0",
3913+
"System.Reflection.Emit.ILGeneration": "4.0.0",
3914+
"System.Reflection.Emit.Lightweight": "4.0.0",
3915+
"System.Reflection.Extensions": "4.0.0",
3916+
"System.Reflection.Primitives": "4.0.0",
3917+
"System.Reflection.TypeExtensions": "4.0.0",
3918+
"System.Resources.ResourceManager": "4.0.0",
3919+
"System.Runtime": "4.0.20",
3920+
"System.Runtime.Extensions": "4.0.10",
3921+
"System.Threading": "4.0.10"
3922+
},
3923+
"compile": {
3924+
"ref/dotnet/_._": {}
3925+
},
3926+
"runtime": {
3927+
"lib/DNXCore50/System.Linq.Expressions.dll": {}
3928+
}
3929+
},
38973930
"runtime.win7.System.Console/4.0.0-beta-23516": {
38983931
"type": "package",
38993932
"dependencies": {
@@ -4699,13 +4732,13 @@
46994732
"lib/DNXCore50/System.Reflection.Emit.ILGeneration.dll": {}
47004733
}
47014734
},
4702-
"System.Reflection.Emit.Lightweight/4.0.0-beta-23109": {
4735+
"System.Reflection.Emit.Lightweight/4.0.0": {
47034736
"type": "package",
47044737
"dependencies": {
4705-
"System.Reflection": "4.0.0-beta-23109",
4706-
"System.Reflection.Emit.ILGeneration": "4.0.0-beta-23109",
4707-
"System.Reflection.Primitives": "4.0.0-beta-23109",
4708-
"System.Runtime": "4.0.0-beta-23109"
4738+
"System.Reflection": "4.0.0",
4739+
"System.Reflection.Emit.ILGeneration": "4.0.0",
4740+
"System.Reflection.Primitives": "4.0.0",
4741+
"System.Runtime": "4.0.0"
47094742
},
47104743
"compile": {
47114744
"ref/dotnet/System.Reflection.Emit.Lightweight.dll": {}
@@ -5752,6 +5785,7 @@
57525785
"System.Diagnostics.Tools": "4.0.1-beta-23225",
57535786
"System.Dynamic.Runtime": "4.0.11-beta-23516",
57545787
"System.Linq": "4.0.0-beta-23109",
5788+
"System.Linq.Expressions": "4.0.11-beta-23516",
57555789
"System.Linq.Queryable": "4.0.0-beta-23109",
57565790
"System.Runtime": "4.0.21-beta-23225",
57575791
"System.Threading": "4.0.11-beta-23225",
@@ -5767,6 +5801,34 @@
57675801
"lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
57685802
}
57695803
},
5804+
"runtime.any.System.Linq.Expressions/4.0.11-beta-23516": {
5805+
"type": "package",
5806+
"dependencies": {
5807+
"System.Collections": "4.0.10",
5808+
"System.Diagnostics.Debug": "4.0.10",
5809+
"System.Globalization": "4.0.10",
5810+
"System.IO": "4.0.10",
5811+
"System.Linq": "4.0.0",
5812+
"System.ObjectModel": "4.0.10",
5813+
"System.Reflection": "4.0.10",
5814+
"System.Reflection.Emit": "4.0.0",
5815+
"System.Reflection.Emit.ILGeneration": "4.0.0",
5816+
"System.Reflection.Emit.Lightweight": "4.0.0",
5817+
"System.Reflection.Extensions": "4.0.0",
5818+
"System.Reflection.Primitives": "4.0.0",
5819+
"System.Reflection.TypeExtensions": "4.0.0",
5820+
"System.Resources.ResourceManager": "4.0.0",
5821+
"System.Runtime": "4.0.20",
5822+
"System.Runtime.Extensions": "4.0.10",
5823+
"System.Threading": "4.0.10"
5824+
},
5825+
"compile": {
5826+
"ref/dotnet/_._": {}
5827+
},
5828+
"runtime": {
5829+
"lib/DNXCore50/System.Linq.Expressions.dll": {}
5830+
}
5831+
},
57705832
"runtime.win7.System.Console/4.0.0-beta-23516": {
57715833
"type": "package",
57725834
"dependencies": {
@@ -6572,13 +6634,13 @@
65726634
"lib/DNXCore50/System.Reflection.Emit.ILGeneration.dll": {}
65736635
}
65746636
},
6575-
"System.Reflection.Emit.Lightweight/4.0.0-beta-23109": {
6637+
"System.Reflection.Emit.Lightweight/4.0.0": {
65766638
"type": "package",
65776639
"dependencies": {
6578-
"System.Reflection": "4.0.0-beta-23109",
6579-
"System.Reflection.Emit.ILGeneration": "4.0.0-beta-23109",
6580-
"System.Reflection.Primitives": "4.0.0-beta-23109",
6581-
"System.Runtime": "4.0.0-beta-23109"
6640+
"System.Reflection": "4.0.0",
6641+
"System.Reflection.Emit.ILGeneration": "4.0.0",
6642+
"System.Reflection.Primitives": "4.0.0",
6643+
"System.Runtime": "4.0.0"
65826644
},
65836645
"compile": {
65846646
"ref/dotnet/System.Reflection.Emit.Lightweight.dll": {}
@@ -7633,6 +7695,28 @@
76337695
"tools/install.ps1"
76347696
]
76357697
},
7698+
"runtime.any.System.Linq.Expressions/4.0.11-beta-23516": {
7699+
"type": "package",
7700+
"serviceable": true,
7701+
"sha512": "4sPxQCjllMJ1uZNlwz/EataPyHSH+AqSDlOIPPqcy/88R2B+abfhPPC78rd7gvHp8KmMX4qbJF6lcCeDIQpmVg==",
7702+
"files": [
7703+
"lib/DNXCore50/System.Linq.Expressions.dll",
7704+
"lib/MonoAndroid10/_._",
7705+
"lib/MonoTouch10/_._",
7706+
"lib/net45/_._",
7707+
"lib/netcore50/System.Linq.Expressions.dll",
7708+
"lib/win8/_._",
7709+
"lib/wp80/_._",
7710+
"lib/wpa81/_._",
7711+
"lib/xamarinios10/_._",
7712+
"lib/xamarinmac20/_._",
7713+
"ref/dotnet/_._",
7714+
"runtime.any.System.Linq.Expressions.4.0.11-beta-23516.nupkg",
7715+
"runtime.any.System.Linq.Expressions.4.0.11-beta-23516.nupkg.sha512",
7716+
"runtime.any.System.Linq.Expressions.nuspec",
7717+
"runtimes/aot/lib/netcore50/_._"
7718+
]
7719+
},
76367720
"runtime.win7.System.Console/4.0.0-beta-23516": {
76377721
"type": "package",
76387722
"serviceable": true,
@@ -7727,7 +7811,7 @@
77277811
"runtime.win7.System.Net.Requests/4.0.11-beta-23516": {
77287812
"type": "package",
77297813
"serviceable": true,
7730-
"sha512": "mqWBQUhXhzkiwb+zVUuKg+wswJUsnQtZkFtz6eISw8vWNXA9i2jkzYjU3pjjIVmtdopnhle9YaS4a/w4OuWGLw==",
7814+
"sha512": "HI99nCEekL4SNvkLmpqkOE0PuEF5B6xyDcnJesdjo06BrGYH3QCvqJt2VmzBVe6hDSo6FnGOlhMvLdCUpDXiXA==",
77317815
"files": [
77327816
"ref/dotnet/_._",
77337817
"runtime.win7.System.Net.Requests.4.0.11-beta-23516.nupkg",
@@ -9523,9 +9607,9 @@
95239607
"System.Reflection.Emit.ILGeneration.nuspec"
95249608
]
95259609
},
9526-
"System.Reflection.Emit.Lightweight/4.0.0-beta-23109": {
9610+
"System.Reflection.Emit.Lightweight/4.0.0": {
95279611
"type": "package",
9528-
"sha512": "Kbg03ijw7jZUswutleX/zmGgz6VYszTuyy4DciBn1PHFYAqAgZFZdK3cpYCsAU+cPliQ35UcOX828OsAG9NU4w==",
9612+
"sha512": "DJZhHiOdkN08xJgsJfDjkuOreLLmMcU8qkEEqEHqyhkPUZMMQs0lE8R+6+68BAFWgcdzxtNu0YmIOtEug8j00w==",
95299613
"files": [
95309614
"lib/DNXCore50/System.Reflection.Emit.Lightweight.dll",
95319615
"lib/net45/_._",
@@ -9544,8 +9628,8 @@
95449628
"ref/dotnet/zh-hant/System.Reflection.Emit.Lightweight.xml",
95459629
"ref/net45/_._",
95469630
"ref/wp80/_._",
9547-
"System.Reflection.Emit.Lightweight.4.0.0-beta-23109.nupkg",
9548-
"System.Reflection.Emit.Lightweight.4.0.0-beta-23109.nupkg.sha512",
9631+
"System.Reflection.Emit.Lightweight.4.0.0.nupkg",
9632+
"System.Reflection.Emit.Lightweight.4.0.0.nupkg.sha512",
95499633
"System.Reflection.Emit.Lightweight.nuspec"
95509634
]
95519635
},

Diff for: src/Elasticsearch.Net/project.lock.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@
17361736
"runtime.win7.System.Net.Requests/4.0.11-beta-23516": {
17371737
"type": "package",
17381738
"serviceable": true,
1739-
"sha512": "mqWBQUhXhzkiwb+zVUuKg+wswJUsnQtZkFtz6eISw8vWNXA9i2jkzYjU3pjjIVmtdopnhle9YaS4a/w4OuWGLw==",
1739+
"sha512": "HI99nCEekL4SNvkLmpqkOE0PuEF5B6xyDcnJesdjo06BrGYH3QCvqJt2VmzBVe6hDSo6FnGOlhMvLdCUpDXiXA==",
17401740
"files": [
17411741
"ref/dotnet/_._",
17421742
"runtime.win7.System.Net.Requests.4.0.11-beta-23516.nupkg",
@@ -3109,9 +3109,9 @@
31093109
"projectFileDependencyGroups": {
31103110
"": [],
31113111
".NETFramework,Version=v4.5": [
3112+
"fx/System ",
31123113
"fx/System.Runtime ",
3113-
"fx/System.Runtime.Serialization ",
3114-
"fx/System "
3114+
"fx/System.Runtime.Serialization "
31153115
],
31163116
".NETPlatform,Version=v5.1": [
31173117
"Microsoft.CSharp >= 4.0.1-beta-23225",

Diff for: src/Nest/CommonAbstractions/ConnectionSettings/MemberInfoResolver.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ public class MemberInfoResolver : FieldResolver
1414

1515
public MemberInfoResolver(IConnectionSettingsValues settings, Expression expression) : base(settings)
1616
{
17-
var stack = new Stack<string>();
18-
var properties = new Stack<ElasticsearchPropertyAttribute>();
19-
base.Visit(expression, stack, properties);
17+
Stack = new Stack<string>();
18+
base.Visit(expression);
2019
}
2120

22-
protected override Expression VisitMemberAccess(MemberExpression expression, Stack<string> stack, Stack<ElasticsearchPropertyAttribute> properties)
21+
protected override Expression VisitMember(MemberExpression expression)
2322
{
2423
this._members.Add(expression.Member);
25-
return base.VisitMemberAccess(expression, stack, properties);
24+
return base.VisitMember(expression);
2625
}
2726
}
2827
}

0 commit comments

Comments
 (0)