File tree 2 files changed +30
-0
lines changed
tests/FSharp.Compiler.ComponentTests 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 169
169
<Compile Include =" Language\ComputationExpressionTests.fs" />
170
170
<Compile Include =" Language\CastingTests.fs" />
171
171
<Compile Include =" Language\NameofTests.fs" />
172
+ <Compile Include =" Language\DotLambdaTests.fs" />
172
173
<Compile Include =" ConstraintSolver\PrimitiveConstraints.fs" />
173
174
<Compile Include =" ConstraintSolver\MemberConstraints.fs" />
174
175
<None Include =" **\*.cs;**\*.fs;**\*.fsx;**\*.fsi" Exclude =" @(Compile)" >
Original file line number Diff line number Diff line change
1
+ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2
+
3
+ namespace FSharp.Compiler.ComponentTests.Language
4
+
5
+ open Xunit
6
+ open FSharp.Test .Compiler
7
+
8
+ module DotLambdaTests =
9
+
10
+ [<Fact>]
11
+ let ``Script : _.ToString () `` () =
12
+ Fsx " _.ToString()"
13
+ |> compile
14
+ |> shouldSucceed
15
+
16
+ let ``Simple anonymous unary function shorthands compile`` () =
17
+ FSharp """
18
+ module One
19
+ let a1 : {| Foo : {| Bar : string |}|} -> string = _.Foo.Bar
20
+ let a2 : {| Foo : int array |} -> int = _.Foo.[5]
21
+ let a3 : {| Foo : int array |} -> int = _.Foo[5]
22
+ let a4 : {| Foo : unit -> string |} -> string = _.Foo()
23
+ let a5 : {| Foo : int -> {| X : string |} |} -> string = _.Foo(5).X
24
+
25
+ open System
26
+ let a6 = [1] |> List.map _.ToString()
27
+ """
28
+ |> compile
29
+ |> shouldSucceed
You can’t perform that action at this time.
0 commit comments