diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 5d56543e992..2d9ea197db4 100644 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -32,8 +32,8 @@ module internal PrintUtilities = let bracketIfL x lyt = if x then bracketL lyt else lyt let squareAngleL x = LeftL.leftBracketAngle ^^ x ^^ RightL.rightBracketAngle let angleL x = sepL Literals.leftAngle ^^ x ^^ rightL Literals.rightAngle - let braceL x = leftL Literals.leftBrace ^^ x ^^ rightL Literals.rightBrace - let braceBarL x = leftL Literals.leftBraceBar ^^ x ^^ rightL Literals.rightBraceBar + let braceL x = wordL Literals.leftBrace ^^ x ^^ wordL Literals.rightBrace + let braceBarL x = wordL Literals.leftBraceBar ^^ x ^^ wordL Literals.rightBraceBar let comment str = wordL (tagText (sprintf "(* %s *)" str)) @@ -942,7 +942,7 @@ module private PrintTypes = // Layout a tuple type | TType_anon (anonInfo, tys) -> - let core = sepListL (wordL (tagPunctuation ";")) (List.map2 (fun nm ty -> wordL (tagField nm) ^^ wordL (tagPunctuation ":") ^^ layoutTypeWithInfoAndPrec denv env prec ty) (Array.toList anonInfo.SortedNames) tys) + let core = sepListL (rightL (tagPunctuation ";")) (List.map2 (fun nm ty -> wordL (tagField nm) ^^ rightL (tagPunctuation ":") ^^ layoutTypeWithInfoAndPrec denv env prec ty) (Array.toList anonInfo.SortedNames) tys) if evalAnonInfoIsStruct anonInfo then WordL.keywordStruct --- braceBarL core else @@ -1457,7 +1457,7 @@ module private TastDefinitionPrinting = let lhs = tagRecordField fld.Name |> mkNav fld.DefinitionRange - |> wordL + |> wordL let lhs = (if addAccess then layoutAccessibility denv fld.Accessibility lhs else lhs) let lhs = if fld.IsMutable then wordL (tagKeyword "mutable") --- lhs else lhs (lhs ^^ RightL.colon) --- layoutType denv fld.FormalType @@ -1738,8 +1738,15 @@ module private TastDefinitionPrinting = let denv = denv.AddAccessibility tycon.TypeReprAccessibility match repr with | TRecdRepr _ -> - let recdFieldRefL fld = layoutRecdField false denv fld ^^ rightL (tagPunctuation ";") - let recdL = tycon.TrueFieldsAsList |> List.map recdFieldRefL |> applyMaxMembers denv.maxMembers |> aboveListL |> braceL + let recdFieldRefL fld = layoutRecdField false denv fld + + let recdL = + tycon.TrueFieldsAsList + |> List.map recdFieldRefL + |> applyMaxMembers denv.maxMembers + |> aboveListL + |> braceL + Some (addMembersAsWithEnd (addReprAccessL recdL)) | TFSharpObjectRepr r -> @@ -1771,8 +1778,7 @@ module private TastDefinitionPrinting = | _ -> [] let vsprs = tycon.MembersOfFSharpTyconSorted - |> List.filter (fun v -> isNil (Option.get v.MemberInfo).ImplementedSlotSigs) - |> List.filter (fun v -> v.IsDispatchSlot) + |> List.filter (fun v -> isNil (Option.get v.MemberInfo).ImplementedSlotSigs && v.IsDispatchSlot) |> List.map (fun vref -> PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv vref.Deref) let staticValsLs = tycon.TrueFieldsAsList diff --git a/src/utils/sformat.fs b/src/utils/sformat.fs index b490283f674..228f4aba399 100644 --- a/src/utils/sformat.fs +++ b/src/utils/sformat.fs @@ -759,18 +759,14 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl // pprinter: attributes // -------------------------------------------------------------------- - let makeRecordVerticalL nameXs = - let itemL (name,xL) = let labelL = wordL name in ((labelL ^^ wordL Literals.equals)) -- (xL ^^ (rightL Literals.semicolon)) - let braceL xs = (leftL Literals.leftBrace) ^^ xs ^^ (rightL Literals.rightBrace) - braceL (aboveListL (List.map itemL nameXs)) - - // This is a more compact rendering of records - and is more like tuples - let makeRecordHorizontalL nameXs = - let itemL (name,xL) = let labelL = wordL name in ((labelL ^^ wordL Literals.equals)) -- xL - let braceL xs = (leftL Literals.leftBrace) ^^ xs ^^ (rightL Literals.rightBrace) - braceL (sepListL (rightL Literals.semicolon) (List.map itemL nameXs)) - - let makeRecordL nameXs = makeRecordVerticalL nameXs + let makeRecordL nameXs = + let itemL (name,xL) = wordL name ^^ wordL Literals.equals -- xL + let braceL xs = (wordL Literals.leftBrace) ^^ xs ^^ (wordL Literals.rightBrace) + + nameXs + |> List.map itemL + |> aboveListL + |> braceL let makePropertiesL nameXs = let itemL (name,v) = diff --git a/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs b/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs new file mode 100644 index 00000000000..21c7bb29269 --- /dev/null +++ b/tests/fsharp/Compiler/ErrorMessages/ElseBranchHasWrongTypeTests.fs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open NUnit.Framework +open FSharp.Compiler.SourceCodeServices + +[] +module ``Else branch has wrong type`` = + + [] + let ``Else branch is int while if branch is string``() = + CompilerAssert.TypeCheckSingleError + """ +let test = 100 +let y = + if test > 10 then "test" + else 123 + """ + FSharpErrorSeverity.Error + 1 + (5, 10, 5, 13) + "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'." + + [] + let ``Else branch is a function that returns int while if branch is string``() = + CompilerAssert.TypeCheckSingleError + """ +let test = 100 +let f x = test +let y = + if test > 10 then "test" + else f 10 + """ + FSharpErrorSeverity.Error + 1 + (6, 10, 6, 14) + "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'." + + + [] + let ``Else branch is a sequence of expressions that returns int while if branch is string``() = + CompilerAssert.TypeCheckSingleError + """ +let f x = x + 4 + +let y = + if true then + "" + else + "" |> ignore + (f 5) + """ + FSharpErrorSeverity.Error + 1 + (9, 10, 9, 13) + "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'." + + + [] + let ``Else branch is a longer sequence of expressions that returns int while if branch is string``() = + CompilerAssert.TypeCheckSingleError + """ +let f x = x + 4 + +let y = + if true then + "" + else + "" |> ignore + let z = f 4 + let a = 3 * z + (f a) + """ + FSharpErrorSeverity.Error + 1 + (11, 10, 11, 13) + "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'." + + + [] + let ``Else branch context doesn't propagate into function application``() = + CompilerAssert.TypeCheckSingleError + """ +let test = 100 +let f x : string = x +let y = + if test > 10 then "test" + else + f 123 + """ + FSharpErrorSeverity.Error + 1 + (7, 11, 7, 14) + "This expression was expected to have type\n 'string' \nbut here has type\n 'int' " + + [] + let ``Else branch context doesn't propagate into function application even if not last expr``() = + CompilerAssert.TypeCheckSingleError + """ +let test = 100 +let f x = printfn "%s" x +let y = + if test > 10 then "test" + else + f 123 + "test" + """ + FSharpErrorSeverity.Error + 1 + (7, 11, 7, 14) + "This expression was expected to have type\n 'string' \nbut here has type\n 'int' " + + [] + let ``Else branch context doesn't propagate into for loop``() = + CompilerAssert.TypeCheckSingleError + """ +let test = 100 +let list = [1..10] +let y = + if test > 10 then "test" + else + for (x:string) in list do + printfn "%s" x + + "test" + """ + FSharpErrorSeverity.Error + 1 + (7, 14, 7, 22) + "This expression was expected to have type\n 'int' \nbut here has type\n 'string' " + + [] + let ``Else branch context doesn't propagate to lines before last line``() = + CompilerAssert.TypeCheckSingleError + """ +let test = 100 +let list = [1..10] +let y = + if test > 10 then "test" + else + printfn "%s" 1 + + "test" + """ + FSharpErrorSeverity.Error + 1 + (7, 22, 7, 23) + "This expression was expected to have type\n 'string' \nbut here has type\n 'int' " + + [] + let ``Else branch should not have wrong context type``() = + CompilerAssert.TypeCheckWithErrors + """ +let x = 1 +let y : bool = + if x = 2 then "A" + else "B" + """ + [| FSharpErrorSeverity.Error, 1, (4, 19, 4, 22), "The 'if' expression needs to have type 'bool' to satisfy context type requirements. It currently has type 'string'." + FSharpErrorSeverity.Error, 1, (5, 10, 5, 13), "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'bool'. This branch returns a value of type 'string'." |] + + + [] + let ``Else branch has wrong type in nested if``() = + CompilerAssert.TypeCheckWithErrors + """ +let x = 1 +if x = 1 then true +else + if x = 2 then "A" + else "B" + """ + [| FSharpErrorSeverity.Error, 1, (5, 19, 5, 22), "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'bool'. This branch returns a value of type 'string'." + FSharpErrorSeverity.Error, 1, (6, 10, 6, 13), "All branches of an 'if' expression must return values of the same type as the first branch, which here is 'bool'. This branch returns a value of type 'string'." + FSharpErrorSeverity.Warning, 20, (3, 1, 6, 13), "The result of this expression has type 'bool' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'." |] diff --git a/tests/fsharp/Compiler/Language/AnonRecordTests.fs b/tests/fsharp/Compiler/Language/AnonRecordTests.fs index 0a4d1c18d9f..befa39f2bfc 100644 --- a/tests/fsharp/Compiler/Language/AnonRecordTests.fs +++ b/tests/fsharp/Compiler/Language/AnonRecordTests.fs @@ -34,7 +34,7 @@ let rAnon = RefClass() FSharpErrorSeverity.Error 1 (3, 13, 3, 42) - "A generic construct requires that the type 'struct {|R : int|}' have reference semantics, but it does not, i.e. it is a struct" + "A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct" [] let StructConstraintFail() = @@ -46,4 +46,4 @@ let sAnon = StructClass<{| S: int |}>() FSharpErrorSeverity.Error 1 (3, 13, 3, 38) - "A generic construct requires that the type '{|S : int|}' is a CLI or F# struct type" \ No newline at end of file + "A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type" diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 10e1f4733ac..6335b5172cd 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -1,4 +1,4 @@ - + @@ -32,6 +32,7 @@ + diff --git a/tests/fsharp/core/anon/lib.fs b/tests/fsharp/core/anon/lib.fs index 9fc219e1cb1..cc3f7de7043 100644 --- a/tests/fsharp/core/anon/lib.fs +++ b/tests/fsharp/core/anon/lib.fs @@ -52,8 +52,8 @@ module KindB1 = check "coijoiwcnkwle1" {| a = 1 |} {| a = 1 |} check "coijoiwcnkwle2" {| a = 2 |} {| a = 2 |} - check "coijoiwcnkwle3" (sprintf "%A" {| X = 10 |}) "{X = 10;}" - check "coijoiwcnkwle4" (sprintf "%A" {| X = 10; Y = 1 |} |> fun s -> s.Replace("\n","").Replace("\r","")) ("{X = 10; Y = 1;}".Replace("\n","").Replace("\r","")) + check "coijoiwcnkwle3" (sprintf "%A" {| X = 10 |}) "{ X = 10 }" + check "coijoiwcnkwle4" (sprintf "%A" {| X = 10; Y = 1 |}) "{ X = 10\n Y = 1 }" check "clekoiew09" (f2 {| X = {| X = 10 |} |}) 10 check "cewkew0oijew" (f2 {| X = {| X = 20 |} |}) 20 diff --git a/tests/fsharp/core/anon/test.fsx b/tests/fsharp/core/anon/test.fsx index 092a8977143..580772b3446 100644 --- a/tests/fsharp/core/anon/test.fsx +++ b/tests/fsharp/core/anon/test.fsx @@ -25,13 +25,13 @@ module Test = let testAccess = (KindB1.data1.X, KindB1.data3.X) - check "coijoiwcnkwle2" (sprintf "%A" KindB1.data1) "{X = 1;}" + check "coijoiwcnkwle2" (sprintf "%A" KindB1.data1) "{ X = 1 }" module Tests2 = let testAccess = (KindB2.data1.X, KindB2.data3.X, KindB2.data3.Y) - check "coijoiwcnkwle3" (sprintf "%A" KindB2.data1) "{X = 1;}" + check "coijoiwcnkwle3" (sprintf "%A" KindB2.data1) "{ X = 1 }" let _ = (KindB2.data1 = KindB2.data1) @@ -49,7 +49,7 @@ module CrossAssemblyTest = check "vrknvio1" (SampleAPI.SampleFunction {| A=1; B = "abc" |}) 4 // note, this is creating an instance of an anonymous record from another assembly. check "vrknvio2" (SampleAPI.SampleFunctionAcceptingList [ {| A=1; B = "abc" |}; {| A=2; B = "def" |} ]) [4; 5] // note, this is creating an instance of an anonymous record from another assembly. check "vrknvio3" (let d = SampleAPI.SampleFunctionReturningAnonRecd() in d.A + d.B.Length) 4 - check "vrknvio4" (let d = SampleAPIStruct.SampleFunctionReturningAnonRecd() in d.ToString().Replace("\n","").Replace("\r","")) """{A = 1; B = "abc";}""" + check "vrknvio4" (let d = SampleAPIStruct.SampleFunctionReturningAnonRecd() in d.ToString()) ("{ A = 1\n " + """B = "abc" }""") tests() module CrossAssemblyTestStruct = diff --git a/tests/fsharp/core/members/basics/test.fs b/tests/fsharp/core/members/basics/test.fs index 27c9e6c3a40..a5da244c0a6 100644 --- a/tests/fsharp/core/members/basics/test.fs +++ b/tests/fsharp/core/members/basics/test.fs @@ -1178,8 +1178,8 @@ module ToStringOnRecordTest = begin let a1 = {A = "201"; B = 7} let c1 = {C = "20"; D = 17} - let expected1 = "{A = \"201\";\n B = 7;}" - let expected2 = "{C = \"20\";\n D = 17;}" + let expected1 = "{ A = \"201\"\n B = 7 }" + let expected2 = "{ C = \"20\"\n D = 17 }" do test "record-tostring-def" (a1.ToString() = expected1) do test "record-sprintfO-def" ((sprintf "%O" a1) = expected1) diff --git a/tests/fsharp/core/printing/z.output.test.1000.stdout.bsl b/tests/fsharp/core/printing/z.output.test.1000.stdout.bsl index 1f9224b67b7..52c96dd7598 100644 --- a/tests/fsharp/core/printing/z.output.test.1000.stdout.bsl +++ b/tests/fsharp/core/printing/z.output.test.1000.stdout.bsl @@ -226,7 +226,7 @@ type T = end val f_as_method : x:int -> int val f_as_thunk : (int -> int) -val refCell : string ref = {contents = "value";} +val refCell : string ref = { contents = "value" } module D1 = begin val words : System.Collections.Generic.IDictionary val words2000 : System.Collections.Generic.IDictionary @@ -1134,7 +1134,7 @@ end | B > type internal T2 = - {x: int;} + { x: int } > type internal T3 @@ -1148,28 +1148,28 @@ end | B > type T2 = - internal {x: int;} + internal { x: int } > type private T1 = | A | B > type private T2 = - {x: int;} + { x: int } > type T1 = private | A | B > type T2 = - private {x: int;} + private { x: int } > type internal T1 = private | A | B > type internal T2 = - private {x: int;} + private { x: int } > type private T3 @@ -1233,121 +1233,121 @@ type 'a T1Pre with member E : IEvent > type r = - {f0: int; - f1: int; - f2: int; - f3: int; - f4: int; - f5: int; - f6: int; - f7: int; - f8: int; - f9: int;} -val r10 : r = {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;} + { f0: int + f1: int + f2: int + f3: int + f4: int + f5: int + f6: int + f7: int + f8: int + f9: int } +val r10 : r = { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 } val r10s : r [] = - [|{f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; ...|] + [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; ...|] val r10s' : string * r [] = ("one extra node", - [|{f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = ...;}; ...|]) + [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = ... }; ...|]) > val x1564_A1 : int = 1 @@ -1398,7 +1398,7 @@ val x1564_A3 : int = 3 | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -1408,22 +1408,22 @@ val x1564_A3 : int = 3 | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -1446,7 +1446,7 @@ module internal PrivateM = begin | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -1456,22 +1456,22 @@ module internal PrivateM = begin | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -1806,9 +1806,9 @@ module Regression1019_long = begin val single_infinity : float32 = infinityf end -> val it : int ref = {contents = 1;} +> val it : int ref = { contents = 1 } -> val x : int ref = {contents = 1;} +> val x : int ref = { contents = 1 } val f : (unit -> int) > val it : int = 1 @@ -2732,11 +2732,11 @@ val namedEx1 : exn = MyNamedException1 (5,"") val namedEx2 : exn = MyNamedException7 25 > type optionRecord = - {x: int option;} -val x : optionRecord = {x = None;} + { x: int option } +val x : optionRecord = { x = None } > type optionRecord = - {x: obj;} -val x : optionRecord = {x = null;} + { x: obj } +val x : optionRecord = { x = null } > > > diff --git a/tests/fsharp/core/printing/z.output.test.200.stdout.bsl b/tests/fsharp/core/printing/z.output.test.200.stdout.bsl index 0877fcb8002..249743e0cff 100644 --- a/tests/fsharp/core/printing/z.output.test.200.stdout.bsl +++ b/tests/fsharp/core/printing/z.output.test.200.stdout.bsl @@ -121,7 +121,7 @@ type T = end val f_as_method : x:int -> int val f_as_thunk : (int -> int) -val refCell : string ref = {contents = "value";} +val refCell : string ref = { contents = "value" } module D1 = begin val words : System.Collections.Generic.IDictionary val words2000 : System.Collections.Generic.IDictionary @@ -458,7 +458,7 @@ end | B > type internal T2 = - {x: int;} + { x: int } > type internal T3 @@ -472,28 +472,28 @@ end | B > type T2 = - internal {x: int;} + internal { x: int } > type private T1 = | A | B > type private T2 = - {x: int;} + { x: int } > type T1 = private | A | B > type T2 = - private {x: int;} + private { x: int } > type internal T1 = private | A | B > type internal T2 = - private {x: int;} + private { x: int } > type private T3 @@ -557,46 +557,46 @@ type 'a T1Pre with member E : IEvent > type r = - {f0: int; - f1: int; - f2: int; - f3: int; - f4: int; - f5: int; - f6: int; - f7: int; - f8: int; - f9: int;} -val r10 : r = {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;} -val r10s : r [] = [|{f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; ...|] -val r10s' : string * r [] = ("one extra node", [|{f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = ...;}; ...|]) + { f0: int + f1: int + f2: int + f3: int + f4: int + f5: int + f6: int + f7: int + f8: int + f9: int } +val r10 : r = { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 } +val r10s : r [] = [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; ...|] +val r10s' : string * r [] = ("one extra node", [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = ... }; ...|]) > val x1564_A1 : int = 1 @@ -647,7 +647,7 @@ val x1564_A3 : int = 3 | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -657,22 +657,22 @@ val x1564_A3 : int = 3 | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -695,7 +695,7 @@ module internal PrivateM = begin | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -705,22 +705,22 @@ module internal PrivateM = begin | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -1055,9 +1055,9 @@ module Regression1019_long = begin val single_infinity : float32 = infinityf end -> val it : int ref = {contents = 1;} +> val it : int ref = { contents = 1 } -> val x : int ref = {contents = 1;} +> val x : int ref = { contents = 1 } val f : (unit -> int) > val it : int = 1 @@ -1981,11 +1981,11 @@ val namedEx1 : exn = MyNamedException1 (5,"") val namedEx2 : exn = MyNamedException7 25 > type optionRecord = - {x: int option;} -val x : optionRecord = {x = None;} + { x: int option } +val x : optionRecord = { x = None } > type optionRecord = - {x: obj;} -val x : optionRecord = {x = null;} + { x: obj } +val x : optionRecord = { x = null } > > > diff --git a/tests/fsharp/core/printing/z.output.test.default.stdout.bsl b/tests/fsharp/core/printing/z.output.test.default.stdout.bsl index fab8d8dbaa8..f861d11fef2 100644 --- a/tests/fsharp/core/printing/z.output.test.default.stdout.bsl +++ b/tests/fsharp/core/printing/z.output.test.default.stdout.bsl @@ -241,7 +241,7 @@ type T = end val f_as_method : x:int -> int val f_as_thunk : (int -> int) -val refCell : string ref = {contents = "value";} +val refCell : string ref = { contents = "value" } module D1 = begin val words : System.Collections.Generic.IDictionary val words2000 : System.Collections.Generic.IDictionary @@ -4072,7 +4072,7 @@ end | B > type internal T2 = - {x: int;} + { x: int } > type internal T3 @@ -4086,28 +4086,28 @@ end | B > type T2 = - internal {x: int;} + internal { x: int } > type private T1 = | A | B > type private T2 = - {x: int;} + { x: int } > type T1 = private | A | B > type T2 = - private {x: int;} + private { x: int } > type internal T1 = private | A | B > type internal T2 = - private {x: int;} + private { x: int } > type private T3 @@ -4171,709 +4171,709 @@ type 'a T1Pre with member E : IEvent > type r = - {f0: int; - f1: int; - f2: int; - f3: int; - f4: int; - f5: int; - f6: int; - f7: int; - f8: int; - f9: int;} -val r10 : r = {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;} + { f0: int + f1: int + f2: int + f3: int + f4: int + f5: int + f6: int + f7: int + f8: int + f9: int } +val r10 : r = { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 } val r10s : r [] = - [|{f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}|] + [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }|] val r10s' : string * r [] = ("one extra node", - [|{f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}; - {f0 = 0; - f1 = 1; - f2 = 2; - f3 = 3; - f4 = 4; - f5 = 5; - f6 = 6; - f7 = 7; - f8 = 8; - f9 = 9;}|]) + [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; + { f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }|]) > val x1564_A1 : int = 1 @@ -4924,7 +4924,7 @@ val x1564_A3 : int = 3 | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -4934,22 +4934,22 @@ val x1564_A3 : int = 3 | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -4972,7 +4972,7 @@ module internal PrivateM = begin | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -4982,22 +4982,22 @@ module internal PrivateM = begin | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -5332,9 +5332,9 @@ module Regression1019_long = begin val single_infinity : float32 = infinityf end -> val it : int ref = {contents = 1;} +> val it : int ref = { contents = 1 } -> val x : int ref = {contents = 1;} +> val x : int ref = { contents = 1 } val f : (unit -> int) > val it : int = 1 @@ -6258,11 +6258,11 @@ val namedEx1 : exn = MyNamedException1 (5,"") val namedEx2 : exn = MyNamedException7 25 > type optionRecord = - {x: int option;} -val x : optionRecord = {x = None;} + { x: int option } +val x : optionRecord = { x = None } > type optionRecord = - {x: obj;} -val x : optionRecord = {x = null;} + { x: obj } +val x : optionRecord = { x = null } > > > diff --git a/tests/fsharp/core/printing/z.output.test.off.stdout.bsl b/tests/fsharp/core/printing/z.output.test.off.stdout.bsl index 2b0d6ca9877..9c90f3e2fac 100644 --- a/tests/fsharp/core/printing/z.output.test.off.stdout.bsl +++ b/tests/fsharp/core/printing/z.output.test.off.stdout.bsl @@ -289,7 +289,7 @@ end | B > type internal T2 = - {x: int;} + { x: int } > type internal T3 @@ -303,28 +303,28 @@ end | B > type T2 = - internal {x: int;} + internal { x: int } > type private T1 = | A | B > type private T2 = - {x: int;} + { x: int } > type T1 = private | A | B > type T2 = - private {x: int;} + private { x: int } > type internal T1 = private | A | B > type internal T2 = - private {x: int;} + private { x: int } > type private T3 @@ -388,16 +388,16 @@ type 'a T1Pre with member E : IEvent > type r = - {f0: int; - f1: int; - f2: int; - f3: int; - f4: int; - f5: int; - f6: int; - f7: int; - f8: int; - f9: int;} + { f0: int + f1: int + f2: int + f3: int + f4: int + f5: int + f6: int + f7: int + f8: int + f9: int } val r10 : r val r10s : r [] val r10s' : string * r [] @@ -451,7 +451,7 @@ val x1564_A3 : int | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -461,22 +461,22 @@ val x1564_A3 : int | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -499,7 +499,7 @@ module internal PrivateM = begin | A | B type T2 = - {x: int;} + { x: int } type T3 type T4 = class @@ -509,22 +509,22 @@ module internal PrivateM = begin | A | B type T6 = - {x: int;} + { x: int } type private T7 = | A | B type private T8 = - {x: int;} + { x: int } type T9 = private | A | B type T10 = - private {x: int;} + private { x: int } type T11 = private | A | B type T12 = - private {x: int;} + private { x: int } type private T13 type private T14 = class @@ -831,7 +831,7 @@ module Regression1019_long = begin val single_infinity : float32 end -> val it : int ref = {contents = 1;} +> val it : int ref = { contents = 1 } > val x : int ref val f : (unit -> int) @@ -1755,11 +1755,11 @@ val namedEx1 : exn val namedEx2 : exn > type optionRecord = - {x: int option;} + { x: int option } val x : optionRecord > type optionRecord = - {x: obj;} + { x: obj } val x : optionRecord > > > diff --git a/tests/fsharp/typecheck/sigs/neg113.bsl b/tests/fsharp/typecheck/sigs/neg113.bsl index 211ba670f91..b9f0190c63b 100644 --- a/tests/fsharp/typecheck/sigs/neg113.bsl +++ b/tests/fsharp/typecheck/sigs/neg113.bsl @@ -3,20 +3,20 @@ neg113.fs(5,50,5,61): typecheck error FS0001: Two anonymous record types have mi neg113.fs(7,41,7,52): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["b"]' and '["a"]' -neg113.fs(10,27,10,55): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion +neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type - '{|b : int|}' + '{| b: int |}' is not compatible with type - '{|a : int|}' + '{| a: int |}' -neg113.fs(13,27,13,62): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion +neg113.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type - '{|a : int ; b : int|}' + '{| a: int; b: int |}' is not compatible with type - '{|a : int|}' + '{| a: int |}' neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharp/typecheck/sigs/neg113.vsbsl b/tests/fsharp/typecheck/sigs/neg113.vsbsl index 211ba670f91..b9f0190c63b 100644 --- a/tests/fsharp/typecheck/sigs/neg113.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg113.vsbsl @@ -3,20 +3,20 @@ neg113.fs(5,50,5,61): typecheck error FS0001: Two anonymous record types have mi neg113.fs(7,41,7,52): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["b"]' and '["a"]' -neg113.fs(10,27,10,55): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion +neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type - '{|b : int|}' + '{| b: int |}' is not compatible with type - '{|a : int|}' + '{| a: int |}' -neg113.fs(13,27,13,62): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion +neg113.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type - '{|a : int ; b : int|}' + '{| a: int; b: int |}' is not compatible with type - '{|a : int|}' + '{| a: int |}' neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl index d7aaaecd939..3e75d81144c 100644 --- a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl +++ b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl @@ -3,20 +3,20 @@ neg_anon_1.fs(5,50,5,61): typecheck error FS0001: Two anonymous record types hav neg_anon_1.fs(7,41,7,52): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["b"]' and '["a"]' -neg_anon_1.fs(10,27,10,55): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion +neg_anon_1.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion neg_anon_1.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type - '{|b : int|}' + '{| b: int |}' is not compatible with type - '{|a : int|}' + '{| a: int |}' -neg_anon_1.fs(13,27,13,62): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion +neg_anon_1.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion neg_anon_1.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type - '{|a : int ; b : int|}' + '{| a: int; b: int |}' is not compatible with type - '{|a : int|}' + '{| a: int |}' neg_anon_1.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx index 052100c05f6..30b453b9fc6 100644 --- a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx +++ b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx @@ -4,14 +4,14 @@ // Test for FSharp1.0:2581 - FSI should display bound values, not just evaluated expressions (was: FSI should print the value of the last declared value is there is no last expression) //type RecT = -// {Name: string;} +// { Name: string } //type Bldg = // \| House // \| Museum // \| Office //val a : int = 1 //val B : string = "Hello" -//val c' : RecT = {Name = "F#";} +//val c' : RecT = { Name = "F#" } //val _d : Bldg = Office //val e : seq //val F'F : int list = \[3; 2; 1] @@ -19,7 +19,7 @@ //val g' : Set<'a> //val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF //val h : System\.Drawing\.PointF = {X=.+, Y=.+} -//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) +//val i : int \* RecT \* Bldg = \(1, { Name = "F#" }, Office\) //val J_ : int \[\] = \[\|1; 2; 3\|] //val j_' : float \[\] = \[\|1\.0; 1\.0\|] //val j_'_ : RecT \[\] = \[\|\|] diff --git a/tests/fsharpqa/Source/Printing/CustomExceptions01.fs b/tests/fsharpqa/Source/Printing/CustomExceptions01.fs index 6f33bff2e19..7a2949be917 100644 --- a/tests/fsharpqa/Source/Printing/CustomExceptions01.fs +++ b/tests/fsharpqa/Source/Printing/CustomExceptions01.fs @@ -16,7 +16,7 @@ exception WeekendEx of WeekendDay if sprintf "%A" (Foo) <> "Foo" || sprintf "%A" (Bar 10) <> "Bar 10" || sprintf "%A" (FooBaz System.DateTime.Today) <> ("FooBaz " + System.DateTime.Today.ToString()) - || sprintf "%A" (MarkupEx {Body = ""}) <> "MarkupEx {Body = \"\";}" + || sprintf "%A" (MarkupEx {Body = ""}) <> "MarkupEx { Body = \"\" }" || sprintf "%A" (WeekendEx Saturday) <> "WeekendEx Saturday" then exit 1 diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInAppl.fs b/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInAppl.fs deleted file mode 100644 index 79152abb78a..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInAppl.fs +++ /dev/null @@ -1,11 +0,0 @@ -// #Warnings -//This expression was expected to have - -let test = 100 -let f x : string = x -let y = - if test > 10 then "test" - else - f 123 - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInAppl2.fs b/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInAppl2.fs deleted file mode 100644 index 5478d8b09d3..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInAppl2.fs +++ /dev/null @@ -1,12 +0,0 @@ -// #Warnings -//This expression was expected to have - -let test = 100 -let f x = printfn "%s" x -let y = - if test > 10 then "test" - else - f 123 - "test" - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInForLoop.fs b/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInForLoop.fs deleted file mode 100644 index bfd5a18dd17..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateInForLoop.fs +++ /dev/null @@ -1,14 +0,0 @@ -// #Warnings -//This expression was expected to have - -let test = 100 -let list = [1..10] -let y = - if test > 10 then "test" - else - for (x:string) in list do - printfn "%s" x - - "test" - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateToLinesBeforeLastLine.fs b/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateToLinesBeforeLastLine.fs deleted file mode 100644 index 9facc603ff6..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchContextDoesntPropagateToLinesBeforeLastLine.fs +++ /dev/null @@ -1,13 +0,0 @@ -// #Warnings -//This expression was expected to have type - -let test = 100 -let list = [1..10] -let y = - if test > 10 then "test" - else - printfn "%s" 1 - - "test" - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongContextType.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongContextType.fs deleted file mode 100644 index 895881ac7be..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongContextType.fs +++ /dev/null @@ -1,9 +0,0 @@ -// #Warnings -//The 'if' expression needs to have type 'bool' - -let x = 1 -let y : bool = - if x = 2 then "A" - else "B" - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs deleted file mode 100644 index b14b495304e..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs +++ /dev/null @@ -1,9 +0,0 @@ -// #Warnings -//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. - -let test = 100 -let y = - if test > 10 then "test" - else 123 - -exit 0 diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs deleted file mode 100644 index 06d83f76aa0..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs +++ /dev/null @@ -1,10 +0,0 @@ -// #Warnings -//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. - -let test = 100 -let f x = test -let y = - if test > 10 then "test" - else f 10 - -exit 0 diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs deleted file mode 100644 index 1306c794759..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs +++ /dev/null @@ -1,13 +0,0 @@ -// #Warnings -//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. - -let f x = x + 4 - -let y = - if true then - "" - else - "" |> ignore - (f 5) - -exit 0 diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs deleted file mode 100644 index 8339a930d30..00000000000 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs +++ /dev/null @@ -1,15 +0,0 @@ -// #Warnings -//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. - -let f x = x + 4 - -let y = - if true then - "" - else - "" |> ignore - let z = f 4 - let a = 3 * z - (f a) - -exit 0 diff --git a/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs b/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs deleted file mode 100644 index a8e63cee65a..00000000000 --- a/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs +++ /dev/null @@ -1,10 +0,0 @@ -// #Warnings -//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'bool'. This branch returns a value of type 'string'. - -let x = 1 -if x = 1 then true -else - if x = 2 then "A" - else "B" - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/env.lst b/tests/fsharpqa/Source/Warnings/env.lst index 383c291e906..127d78a21c5 100644 --- a/tests/fsharpqa/Source/Warnings/env.lst +++ b/tests/fsharpqa/Source/Warnings/env.lst @@ -45,16 +45,6 @@ SOURCE=SuggestDoubleBacktickIdentifiers.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickIdentifiers.fs SOURCE=SuggestDoubleBacktickUnions.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickUnions.fs SOURCE=GuardHasWrongType.fs # GuardHasWrongType.fs - SOURCE=ElseBranchHasWrongType.fs # ElseBranchHasWrongType.fs - SOURCE=ElseBranchHasWrongType2.fs # ElseBranchHasWrongType2.fs - SOURCE=ElseBranchHasWrongType3.fs # ElseBranchHasWrongType3.fs - SOURCE=ElseBranchHasWrongType4.fs # ElseBranchHasWrongType4.fs - SOURCE=NestedElseBranchHasWrongType.fs # NestedElseBranchHasWrongType.fs - SOURCE=ElseBranchHasWrongContextType.fs # ElseBranchHasWrongContextType.fs - SOURCE=ElseBranchContextDoesntPropagateInAppl.fs # ElseBranchContextDoesntPropagateInAppl.fs - SOURCE=ElseBranchContextDoesntPropagateInAppl2.fs # ElseBranchContextDoesntPropagateInAppl2.fs - SOURCE=ElseBranchContextDoesntPropagateInForLoop.fs # ElseBranchContextDoesntPropagateInForLoop.fs - SOURCE=ElseBranchContextDoesntPropagateToLinesBeforeLastLine.fs # ElseBranchContextDoesntPropagateToLinesBeforeLastLine.fs SOURCE=MatchingMethodWithSameNameIsNotAbstract.fs # MatchingMethodWithSameNameIsNotAbstract.fs SOURCE=NoMatchingAbstractMethodWithSameName.fs # NoMatchingAbstractMethodWithSameName.fs SOURCE=MissingExpressionAfterLet.fs # MissingExpressionAfterLet.fs diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs index 16d2f34a4e8..09f358678df 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs @@ -762,7 +762,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") let fileContents = """namespace NS type Re(*MarkerRecord*) = { X : int } """ - let expectedQuickinfoTypeRecored = "type Re = {X: int;}" + let expectedQuickinfoTypeRecored = "type Re = { X: int }" this.InfoInDeclarationTestQuickInfoImplWithTrim fileContents "Re(*MarkerRecord*)" expectedQuickinfoTypeRecored diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index bfa6c7df729..415079942e7 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -154,9 +154,9 @@ module Test = let quickInfo = GetQuickInfoTextFromCode code let expected = expectedLines [ "type MyEmployee =" - " {mutable Name: string;" - " mutable Age: int;" - " mutable IsFTE: bool;}" + " { mutable Name: string" + " mutable Age: int" + " mutable IsFTE: bool }" "Full name: FsTest.MyEmployee" ] Assert.AreEqual(expected, quickInfo) ()