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

Commit585336c

Browse files
author
Jack Pappas
committed
Extended support for array types to include all ranks supported by .NET (i.e., up to rank 32). This fixes a bug where the F# compiler wouldn't allow F# code to call an overloaded method or constructor when one or more of those overloads contained one or more parameters whose type was an array with rank greater than 4 (even when the overload being called did not include such a parameter).
1 parent2d57389 commit585336c

File tree

8 files changed

+234
-107
lines changed

8 files changed

+234
-107
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ typeInfoCallsWord,"Calls"
12851285
3135,parsMutableOnAutoPropertyShouldBeGetSetNotJustSet,"To indicate that this property can be set, use 'member val PropertyName = expr with get,set'."
12861286
3136,chkNoByrefsOfByrefs,"Type '%s' is illegal because in byref<T>, T cannot contain byref types."
12871287
3137,etTypeProviderNotApproved,"Type provider assembly '%s' is not trusted and will not be loaded for security reasons. This may cause subsequent build errors. See the 'F# Tools' section of Visual Studio options for more information."
1288-
3138,tastopsMaxArrayFour,"F# supports a maximum array rank of4"
1288+
3138,tastopsMaxArrayThirtyTwo,"F# supports a maximum array rank of32"
12891289
3139,tcNoIntegerForLoopInQuery,"In queries, use the form 'for x in n .. m do ...' for ranging over integers"
12901290
3140,tcNoWhileInQuery,"'while' expressions may not be used in queries"
12911291
3141,tcNoTryFinallyInQuery,"'try/finally' expressions may not be used in queries"

‎src/fsharp/FSharp.Core/prim-types-prelude.fs‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,34 @@ namespace Microsoft.FSharp.Core
3333
type ``[,]``<'T>=(#"!0[0 ...,0 ...]" #)
3434
type ``[,,]``<'T>=(#"!0[0 ...,0 ...,0 ...]" #)
3535
type ``[,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...]" #)
36+
type ``[,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...]" #)
37+
type ``[,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
38+
type ``[,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
39+
type ``[,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
40+
type ``[,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
41+
type ``[,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
42+
type ``[,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
43+
type ``[,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
44+
type ``[,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
45+
type ``[,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
46+
type ``[,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
47+
type ``[,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
48+
type ``[,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
49+
type ``[,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
50+
type ``[,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
51+
type ``[,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
52+
type ``[,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
53+
type ``[,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
54+
type ``[,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
55+
type ``[,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
56+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
57+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
58+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
59+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
60+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
61+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
62+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
63+
type ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``<'T>=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
3664

3765
typearray<'T>= 'T[]
3866

‎src/fsharp/FSharp.Core/prim-types-prelude.fsi‎

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,118 @@ namespace Microsoft.FSharp.Core
9696
/// to manipulate values of this type, or the notation <c>arr.[x1,x2,x3,x4]</c> to get and set array
9797
/// values.</remarks>
9898
type'T ``[,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...]" #)
99+
100+
/// <summary>Five dimensional arrays, typically zero-based. Non-zero-based arrays
101+
/// can be created using methods on the System.Array type.</summary>
102+
type'T ``[,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...]" #)
103+
104+
/// <summary>Six dimensional arrays, typically zero-based. Non-zero-based arrays
105+
/// can be created using methods on the System.Array type.</summary>
106+
type'T ``[,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
107+
108+
/// <summary>Seven dimensional arrays, typically zero-based. Non-zero-based arrays
109+
/// can be created using methods on the System.Array type.</summary>
110+
type'T ``[,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
111+
112+
/// <summary>Eight dimensional arrays, typically zero-based. Non-zero-based arrays
113+
/// can be created using methods on the System.Array type.</summary>
114+
type'T ``[,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
115+
116+
/// <summary>Nine dimensional arrays, typically zero-based. Non-zero-based arrays
117+
/// can be created using methods on the System.Array type.</summary>
118+
type'T ``[,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
119+
120+
/// <summary>Ten dimensional arrays, typically zero-based. Non-zero-based arrays
121+
/// can be created using methods on the System.Array type.</summary>
122+
type'T ``[,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
123+
124+
/// <summary>Eleven dimensional arrays, typically zero-based. Non-zero-based arrays
125+
/// can be created using methods on the System.Array type.</summary>
126+
type'T ``[,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
127+
128+
/// <summary>Twelve dimensional arrays, typically zero-based. Non-zero-based arrays
129+
/// can be created using methods on the System.Array type.</summary>
130+
type'T ``[,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
131+
132+
/// <summary>Thirteen dimensional arrays, typically zero-based. Non-zero-based arrays
133+
/// can be created using methods on the System.Array type.</summary>
134+
type'T ``[,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
135+
136+
/// <summary>Fourteen dimensional arrays, typically zero-based. Non-zero-based arrays
137+
/// can be created using methods on the System.Array type.</summary>
138+
type'T ``[,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
139+
140+
/// <summary>Fifteen dimensional arrays, typically zero-based. Non-zero-based arrays
141+
/// can be created using methods on the System.Array type.</summary>
142+
type'T ``[,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
143+
144+
/// <summary>Sixteen dimensional arrays, typically zero-based. Non-zero-based arrays
145+
/// can be created using methods on the System.Array type.</summary>
146+
type'T ``[,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
147+
148+
/// <summary>Seventeen dimensional arrays, typically zero-based. Non-zero-based arrays
149+
/// can be created using methods on the System.Array type.</summary>
150+
type'T ``[,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
151+
152+
/// <summary>Eighteen dimensional arrays, typically zero-based. Non-zero-based arrays
153+
/// can be created using methods on the System.Array type.</summary>
154+
type'T ``[,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
155+
156+
/// <summary>Nineteen dimensional arrays, typically zero-based. Non-zero-based arrays
157+
/// can be created using methods on the System.Array type.</summary>
158+
type'T ``[,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
159+
160+
/// <summary>Twenty dimensional arrays, typically zero-based. Non-zero-based arrays
161+
/// can be created using methods on the System.Array type.</summary>
162+
type'T ``[,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
163+
164+
/// <summary>Twenty-one dimensional arrays, typically zero-based. Non-zero-based arrays
165+
/// can be created using methods on the System.Array type.</summary>
166+
type'T ``[,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
167+
168+
/// <summary>Twenty-two dimensional arrays, typically zero-based. Non-zero-based arrays
169+
/// can be created using methods on the System.Array type.</summary>
170+
type'T ``[,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
171+
172+
/// <summary>Twenty-three dimensional arrays, typically zero-based. Non-zero-based arrays
173+
/// can be created using methods on the System.Array type.</summary>
174+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
175+
176+
/// <summary>Twenty-four dimensional arrays, typically zero-based. Non-zero-based arrays
177+
/// can be created using methods on the System.Array type.</summary>
178+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
179+
180+
/// <summary>Twenty-five dimensional arrays, typically zero-based. Non-zero-based arrays
181+
/// can be created using methods on the System.Array type.</summary>
182+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
183+
184+
/// <summary>Twenty-six dimensional arrays, typically zero-based. Non-zero-based arrays
185+
/// can be created using methods on the System.Array type.</summary>
186+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
187+
188+
/// <summary>Twenty-seven dimensional arrays, typically zero-based. Non-zero-based arrays
189+
/// can be created using methods on the System.Array type.</summary>
190+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
191+
192+
/// <summary>Twenty-eight dimensional arrays, typically zero-based. Non-zero-based arrays
193+
/// can be created using methods on the System.Array type.</summary>
194+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
195+
196+
/// <summary>Twenty-nine dimensional arrays, typically zero-based. Non-zero-based arrays
197+
/// can be created using methods on the System.Array type.</summary>
198+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
199+
200+
/// <summary>Thirty dimensional arrays, typically zero-based. Non-zero-based arrays
201+
/// can be created using methods on the System.Array type.</summary>
202+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
203+
204+
/// <summary>Thirty-one dimensional arrays, typically zero-based. Non-zero-based arrays
205+
/// can be created using methods on the System.Array type.</summary>
206+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
207+
208+
/// <summary>Thirty-two dimensional arrays, typically zero-based. Non-zero-based arrays
209+
/// can be created using methods on the System.Array type.</summary>
210+
type'T ``[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]``=(#"!0[0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...,0 ...]" #)
99211

100212
/// <summary>Single dimensional, zero-based arrays, written <c>int[]</c>, <c>string[]</c> etc.</summary>
101213
///

‎src/fsharp/creflect.fs‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ let (|SimpleArrayLoopUpperBound|_|) expr =
125125
let(|SimpleArrayLoopBody|_|)g expr=
126126
match exprwith
127127
| Expr.Lambda(_, a, b,([_]as args), Expr.Let(TBind(forVarLoop, Expr.Op(TOp.ILAsm([I_ldelem_any(ILArrayShape[(Some0, None)],_)],_),[elemTy],[arr; idx], m1), seqPoint), body, m2, freeVars), m, ty)->
128-
letbody= Expr.Let(TBind(forVarLoop, mkCallArrayGet g m1 elemTy arr idx, seqPoint), body, m2, freeVars)
128+
letbody= Expr.Let(TBind(forVarLoop, mkCallArrayGet g m11elemTy arr[idx], seqPoint), body, m2, freeVars)
129129
letexpr= Expr.Lambda(newUnique(), a, b, args, body, m, ty)
130130
Some(arr, elemTy, expr)
131131
|_-> None
@@ -628,13 +628,10 @@ and ConvLValueExprCore cenv env expr =
628628
| TOp.ValFieldGetAddr(rfref),_,_-> ConvRFieldGet cenv env m rfref tyargs args
629629
| TOp.ILAsm([ I_ldflda(fspec)],_rtys),_,_-> ConvLdfld cenv env m fspec tyargs args
630630
| TOp.ILAsm([ I_ldsflda(fspec)],_rtys),_,_-> ConvLdfld cenv env m fspec tyargs args
631-
| TOp.ILAsm(([ I_ldelema(_ro,_isNativePtr,shape,_tyarg)]),_),(arr::idxs),[elemty]->
632-
match shape.Rank, idxswith
633-
|1,[idx1]-> ConvExpr cenv env(mkCallArrayGet cenv.g m elemty arr idx1)
634-
|2,[idx1; idx2]-> ConvExpr cenv env(mkCallArray2DGet cenv.g m elemty arr idx1 idx2)
635-
|3,[idx1; idx2; idx3]-> ConvExpr cenv env(mkCallArray3DGet cenv.g m elemty arr idx1 idx2 idx3)
636-
|4,[idx1; idx2; idx3; idx4]-> ConvExpr cenv env(mkCallArray4DGet cenv.g m elemty arr idx1 idx2 idx3 idx4)
637-
|_-> ConvExpr cenv env expr
631+
| TOp.ILAsm(([ I_ldelema(_ro,_isNativePtr,shape,_tyarg)]),_),(arr::idxs),[elemty]
632+
when shape.Rank= List.length idxs->
633+
assert(shape.Rank>=1&& shape.Rank<=32)
634+
ConvExpr cenv env(mkCallArrayGet cenv.g m shape.Rank elemty arr idxs)
638635
|_-> ConvExpr cenv env expr
639636
|_-> ConvExpr cenv env expr
640637

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp