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

Commit0a5f3e1

Browse files
committed
Expand\refactor tests a bit for consuming high-D arrays
1 parentb49825b commit0a5f3e1

File tree

5 files changed

+53
-25
lines changed

5 files changed

+53
-25
lines changed

‎tests/fsharp/typecheck/full-rank-arrays/Class1.cs‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,27 @@ public static void Example(T[, , , , , , , , , ,] array)
180180
thrownewNotImplementedException();
181181
}
182182
}
183+
184+
publicstaticclassMethodsReturningHighDArrays
185+
{
186+
publicstaticT1[,]Example1<T1>()
187+
{
188+
thrownewNotImplementedException();
189+
}
190+
191+
publicstaticT1[,,,,,]Example1<T1>(intx)
192+
{
193+
thrownewNotImplementedException();
194+
}
195+
196+
publicstaticT1[,]Example2<T1>()
197+
{
198+
thrownewNotImplementedException();
199+
}
200+
201+
publicstaticT1[,,,,,,]Example2<T1,T2>()
202+
{
203+
thrownewNotImplementedException();
204+
}
205+
}
183206
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
@if"%_echo%"==""echooff
22

3+
call%~d0%~p0..\..\..\config.bat
4+
5+
%CSC% /target:library /out:HighRankArrayTests.dll .\Class1.cs
6+
37
call%~d0%~p0..\..\single-test-build.bat
48

59
exit /b%ERRORLEVEL%

‎tests/fsharp/typecheck/full-rank-arrays/test.fs‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎tests/fsharp/typecheck/full-rank-arrays/test.fsx‎

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,46 @@
44
#r"HighRankArrayTests.dll"
55
openHighRankArrayTests
66

7-
(* In the F# 3.1 release and earlier versions, the compiler's overload resolution
7+
(* In the F# 3.1.2 release and earlier versions, the compiler's overload resolution
88
breaks on the following class definition. The referenced assembly defines
99
several classes with various overloaded methods and constructors; some of these
1010
overloads include parameters whose type is a "high-rank" array -- that is,
1111
an array of rank 5-32. Arrays with these ranks are not currently supported by
1212
F#, but it should still be possible to call one of the overloads which does
1313
not include such a parameter.*)
1414
typeClass1()=
15-
memberthis.X=
15+
memberthis.X1=
1616
GenericStaticClassWithMethod<int>.Example[|2;3;4;5|]
1717

18-
memberthis.Y=
18+
memberthis.X2=
1919
StaticClassWithGenericMethod.Example[|1;2;3;4|]
2020

21-
memberthis.Z=
21+
memberthis.X3=
2222
letfoo= ClassWithArrayCtor([|1;3;5;7|])
2323
()
2424

25+
memberthis.X4=
26+
lety1= MethodsReturningHighDArrays.Example1<int>()
27+
lety2= MethodsReturningHighDArrays.Example1<int>(2)
28+
29+
StaticClassWithGenericMethod.Example(y1)
30+
StaticClassWithGenericMethod.Example(y2)
31+
ClassWithArrayCtor(y1)|> ignore
32+
ClassWithArrayCtor(y2)|> ignore
33+
34+
()
35+
36+
memberthis.X5=
37+
lety1= MethodsReturningHighDArrays.Example2<_>()
38+
lety2= MethodsReturningHighDArrays.Example2<_,_>()
39+
40+
StaticClassWithGenericMethod.Example(y1)
41+
StaticClassWithGenericMethod.Example(y2)
42+
ClassWithArrayCtor(y1)|> ignore
43+
ClassWithArrayCtor(y2)|> ignore
44+
45+
()
46+
2547
(* avoid ;; -- to avoid fsi error recovery*)
2648

2749
let_=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp