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

Commita443cf5

Browse files
v2munknown
authored and
unknown
committed
test added
1 parent9cc7edb commita443cf5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

‎tests/fsharpqa/Source/Misc/ConsumeParamArray.fsscript‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type Foo() =
1616
[<AttributeWithParamArray([| ("foo" :> obj); ("bar" :> obj) |])>]
1717
override this.ToString() = "Stuff"
1818

19+
let callCSGenericMethod (a: 't[]) = CSParamArray.Method(a)
20+
1921
[<assembly:AttributeWithParamArray ([| |])>]
2022
do
2123
let getTestAttribute (t : Type) =
@@ -40,7 +42,15 @@ do
4042
if not asArrayCallWorks then
4143
printfn "Calling C# param array method, passing args as an array, gave unexpected result"
4244
exit 1
43-
45+
46+
if callCSGenericMethod [|"1";"2";"3"|] <> 3 then
47+
printfn "Calling C# generic param array method gave unexpected result"
48+
exit 1
49+
50+
if CSParamArray.Method("1", "2", "3") <> CSParamArray.Method([|"1"; "2"; "3"|]) then
51+
printfn "Calling C# generic param array in normal and expanded method gave unexpected result"
52+
exit 1
53+
4454
exit 0
4555

4656

‎tests/fsharpqa/Source/Misc/ParamArray.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ public static int Method(params int[] allArgs)
2424

2525
returntotal;
2626
}
27+
28+
publicstaticintMethod<T>(paramsT[]args)
29+
{
30+
returnargs.Length;
31+
}
2732
}
2833
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp