-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support of SynExpr.DotLambda and SynType.Intersection (#2920)
* Initial support of SynExpr.DotLambda. * Update tests * Add initial support for SynType.Intersection * Add regression test for corrected range. * Add changelog entries.
- Loading branch information
Showing
9 changed files
with
218 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module Fantomas.Core.Tests.ConstraintIntersectionTests | ||
|
||
open NUnit.Framework | ||
open FsUnit | ||
open Fantomas.Core.Tests.TestHelpers | ||
|
||
[<Test>] | ||
let ``constraint intersection in type annotation`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let y (f: #I & #Task<int> & #seq<string>) = () | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let y (f: #I & #Task<int> & #seq<string>) = () | ||
""" | ||
|
||
[<Test>] | ||
let ``constraint intersection with leading typar`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let y (f: 't & #I & #IDisposable & #seq<int> & #I2) = () | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let y (f: 't & #I & #IDisposable & #seq<int> & #I2) = () | ||
""" | ||
|
||
[<Test>] | ||
let ``usage in member`` () = | ||
formatSourceString | ||
false | ||
""" | ||
type I = | ||
abstract h: #IDisposable & #seq<int> & #I -> unit | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
type I = | ||
abstract h: #IDisposable & #seq<int> & #I -> unit | ||
""" |
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,65 @@ | ||
module Fantomas.Core.Tests.DotLambdaTests | ||
|
||
open NUnit.Framework | ||
open FsUnit | ||
open Fantomas.Core.Tests.TestHelpers | ||
|
||
[<Test>] | ||
let ``function call`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let x = "a" |> _.ToString() | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let x = "a" |> _.ToString() | ||
""" | ||
|
||
[<Test>] | ||
let ``property call`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let x = "a" |> _.Length | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let x = "a" |> _.Length | ||
""" | ||
|
||
[<Test>] | ||
let ``property of method invocation`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let c = _.ToString().Length | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let c = _.ToString().Length | ||
""" | ||
|
||
[<Test>] | ||
let ``property of function invocation`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let c = _.foo().Length | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let c = _.foo().Length | ||
""" |
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