Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe2002b

Browse files
Alan GellerKevinRansom
Alan Geller
authored andcommitted
Bug fix to allow RebuildShapeCombination for indexed static property gets (dotnet#2512)
* Bug fix to allow RebuildShapeCombination to rebuild gets of indexed static properties* Unit test for RebuildShapeCombination of indexed static property
1 parent527d6de commitfe2002b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Quotations/FSharpQuotations.fs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ open Microsoft.FSharp.Quotations
1111

1212
typeE= Microsoft.FSharp.Quotations.Expr;;
1313

14+
typeStaticIndexedPropertyTest()=
15+
static memberIdxPropwith get(n:int)= n+1
16+
1417
moduleCheck=
1518
letargumentException f=
1619
let mutableex=false
@@ -68,6 +71,17 @@ type FSharpQuotationsTests() =
6871
Check.argumentException(fun()-> ExprShape.RebuildShapeCombination(shape,[wrongValue;lambda]))
6972
|_-> Assert.Fail()
7073

74+
[<Test>]
75+
memberx.ReShapeStaticIndexedProperties()=
76+
letq0=<@ StaticIndexedPropertyTest.IdxProp5@>
77+
match q0with
78+
| ExprShape.ShapeCombination(shape, args)->
79+
try
80+
ExprShape.RebuildShapeCombination(shape, args)|> ignore
81+
with
82+
|_-> Assert.Fail()
83+
|_-> Assert.Fail()
84+
7185
[<Test>]
7286
memberx.GetConstructorFiltersOutStaticConstructor()=
7387
ignore<@ System.Exception()@>

‎src/fsharp/FSharp.Core/quotations.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ module ExprShape =
21712171
| NewTupleOp(ty),_-> mkNewTupleWithType(ty, args)
21722172
| TupleGetOp(ty,i),[arg]-> mkTupleGet(ty,i,arg)
21732173
| InstancePropGetOp(pinfo),(obj::args)-> mkInstancePropGet(obj,pinfo,args)
2174-
| StaticPropGetOp(pinfo),[]-> mkStaticPropGet(pinfo,args)
2174+
| StaticPropGetOp(pinfo),_-> mkStaticPropGet(pinfo,args)
21752175
| InstancePropSetOp(pinfo),obj::(FrontAndBack(args,v))-> mkInstancePropSet(obj,pinfo,args,v)
21762176
| StaticPropSetOp(pinfo),(FrontAndBack(args,v))-> mkStaticPropSet(pinfo,args,v)
21772177
| InstanceFieldGetOp(finfo),[obj]-> mkInstanceFieldGet(obj,finfo)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp