File tree Expand file tree Collapse file tree 5 files changed +18
-1
lines changed
tests/FSharp.Compiler.ComponentTests Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ module internal PrintUtilities =
164164
165165 let usePrefix ( denv : DisplayEnv ) ( tcref : TyconRef ) =
166166 match denv.genericParameterStyle with
167- | GenericParameterStyle.Implicit -> tcref.IsPrefixDisplay
167+ | GenericParameterStyle.Implicit -> not ( isSeqTyconRef denv.g tcref ) && tcref.IsPrefixDisplay
168168 | GenericParameterStyle.Prefix -> true
169169 | GenericParameterStyle.Suffix -> false
170170
Original file line number Diff line number Diff line change @@ -1749,6 +1749,9 @@ let isArrayTyconRef (g: TcGlobals) tcref =
17491749 g.il_ arr_ tcr_ map
17501750 |> Array.exists ( tyconRefEq g tcref)
17511751
1752+ let isSeqTyconRef ( g : TcGlobals ) tcref =
1753+ tyconRefEq g g.seq_ tcr tcref
1754+
17521755let rankOfArrayTyconRef ( g : TcGlobals ) tcref =
17531756 match g.il_ arr_ tcr_ map |> Array.tryFindIndex ( tyconRefEq g tcref) with
17541757 | Some idx ->
Original file line number Diff line number Diff line change @@ -1618,6 +1618,9 @@ val mkArrayTy: TcGlobals -> int -> TType -> range -> TType
16181618/// Check if a type definition is one of the artificial type definitions used for array types of different ranks
16191619val isArrayTyconRef : TcGlobals -> TyconRef -> bool
16201620
1621+ /// Check if a type definition is of Microsoft.FSharp.Collections.seq`1
1622+ val isSeqTyconRef : TcGlobals -> TyconRef -> bool
1623+
16211624/// Determine the rank of one of the artificial type definitions used for array types
16221625val rankOfArrayTyconRef : TcGlobals -> TyconRef -> int
16231626
Original file line number Diff line number Diff line change 244244 <Compile Include =" Signatures\ModuleOrNamespaceTests.fs" />
245245 <Compile Include =" Signatures\RecordTests.fs" />
246246 <Compile Include =" Signatures\ArrayTests.fs" />
247+ <Compile Include =" Signatures\SeqTests.fs" />
247248 <Compile Include =" Signatures\TypeTests.fs" />
248249 <Compile Include =" Signatures\SigGenerationRoundTripTests.fs" />
249250 <Compile Include =" StaticLinking\StaticLinking.fs" />
Original file line number Diff line number Diff line change 1+ module FSharp.Compiler.ComponentTests.Signatures.SeqTests
2+
3+ open Xunit
4+ open FSharp.Compiler .ComponentTests .Signatures .TestHelpers
5+
6+ [<Fact>]
7+ let ``int seq`` () =
8+ assertSingleSignatureBinding
9+ " let s = seq { yield 1 }"
10+ " val s: int seq"
You can’t perform that action at this time.
0 commit comments