-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.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,29 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
||
namespace FSharp.Compiler.ComponentTests.Language | ||
|
||
open Xunit | ||
open FSharp.Test.Compiler | ||
|
||
module DotLambdaTests = | ||
|
||
[<Fact>] | ||
let ``Script: _.ToString()`` () = | ||
Fsx "_.ToString()" | ||
|> compile | ||
|> shouldSucceed | ||
|
||
let ``Simple anonymous unary function shorthands compile`` () = | ||
FSharp """ | ||
module One | ||
let a1 : {| Foo : {| Bar : string |}|} -> string = _.Foo.Bar | ||
let a2 : {| Foo : int array |} -> int = _.Foo.[5] | ||
let a3 : {| Foo : int array |} -> int = _.Foo[5] | ||
let a4 : {| Foo : unit -> string |} -> string = _.Foo() | ||
let a5 : {| Foo : int -> {| X : string |} |} -> string = _.Foo(5).X | ||
open System | ||
let a6 = [1] |> List.map _.ToString() | ||
""" | ||
|> compile | ||
|> shouldSucceed |