-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into missing-xml-doc-for-member-getset
- Loading branch information
Showing
35 changed files
with
1,090 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module FSharp.Compiler.ComponentTests.Signatures.SignatureTests | ||
|
||
open Xunit | ||
open FSharp.Compiler.ComponentTests.Signatures.TestHelpers | ||
|
||
[<Theory>] | ||
[<InlineData("let a : int[] = [| 1 |]", | ||
"val a: int array")>] | ||
[<InlineData("let b: int array = [| 2 |]", | ||
"val b: int array")>] | ||
[<InlineData("let c: array<int> = [| 3 |]", | ||
"val c: int array")>] | ||
let ``Value with int array return type`` implementation expectedSignature = | ||
assertSingleSignatureBinding implementation expectedSignature | ||
|
||
[<Fact>] | ||
let ``2 dimensional array`` () = | ||
assertSingleSignatureBinding | ||
"let a : int[,] = failwith \"todo\"" | ||
"val a: int array2d" | ||
|
||
[<Fact>] | ||
let ``3 dimensional array`` () = | ||
assertSingleSignatureBinding | ||
"let a : int[,,] = failwith \"todo\"" | ||
"val a: int array3d" | ||
|
||
[<Fact>] | ||
let ``4 dimensional array`` () = | ||
assertSingleSignatureBinding | ||
"let a : int[,,,] = failwith \"todo\"" | ||
"val a: int array4d" | ||
|
||
[<Fact>] | ||
let ``5 till 32 dimensional array`` () = | ||
[ 5 .. 32 ] | ||
|> List.iter (fun idx -> | ||
let arrayType = | ||
[ 1 .. idx ] | ||
|> List.fold (fun acc _ -> $"array<{acc}>") "int" | ||
|
||
assertSingleSignatureBinding | ||
$"let a : {arrayType} = failwith \"todo\"" | ||
$"val a: int array{idx}d" | ||
) | ||
|
||
[<Fact>] | ||
let ``Use array2d syntax in implementation`` () = | ||
assertSingleSignatureBinding | ||
"let y : int array2d = Array2D.init 0 0 (fun _ _ -> 0)" | ||
"val y: int array2d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.