From 6053578e3add48ae60c2f00f7648983d7498ae2f Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Sat, 11 Oct 2025 20:43:26 +0200 Subject: [PATCH 1/5] fix sneakily disabled tests --- .../Miscellaneous/FsharpSuiteMigrated.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs index ecba3a3fa85..783528e1bd4 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs @@ -172,7 +172,7 @@ module TestFrameworkAdapter = let singleTestBuildAndRunIsolated folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest ScriptSessionIsolation.Isolated let singleVersionedNegTestAux folder bonusArgs version testName = - singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version + singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version ScriptSessionIsolation.Shared let singleVersionedNegTest (folder:string) (version:LangVersion) (testName:string) = singleVersionedNegTestAux folder [] version testName let singleNegTest folder testName = singleVersionedNegTest folder LangVersion.Latest testName \ No newline at end of file From e52abb0c9c62528c8347296e93c2e93f053e6f9c Mon Sep 17 00:00:00 2001 From: majocha <1760221+majocha@users.noreply.github.com> Date: Sun, 12 Oct 2025 10:40:10 +0200 Subject: [PATCH 2/5] print more info --- tests/FSharp.Test.Utilities/Compiler.fs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 111f683188e..ba954b0ce53 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1833,15 +1833,18 @@ Actual: let expectedContent = File.ReadAllText(path) |> normalizeNewLines let actualErrors = renderToString result - match Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") with - | null -> () - | _ when expectedContent = actualErrors -> () - | _ -> File.WriteAllText(path, actualErrors) - //File.WriteAllText(path, actualErrors) - match Assert.shouldBeSameMultilineStringSets expectedContent actualErrors with | None -> () - | Some diff -> Assert.True(String.IsNullOrEmpty(diff), path) + | Some diff -> + if Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") <> null then + File.WriteAllText(path, actualErrors) + + printfn $"{Path.GetFullPath path} \n {diff}" + printfn "==========================EXPECTED===========================" + printfn "%s" expectedContent + printfn "===========================ACTUAL============================" + printfn "%s" actualErrors + Assert.True(String.IsNullOrEmpty(diff), path) result From 25d44bd3094b18f1616885deb42408aaf70f36e0 Mon Sep 17 00:00:00 2001 From: majocha <1760221+majocha@users.noreply.github.com> Date: Sun, 12 Oct 2025 12:39:38 +0200 Subject: [PATCH 3/5] update baselines --- tests/fsharp/typecheck/sigs/neg04.bsl | 2 +- tests/fsharp/typecheck/sigs/neg05.bsl | 22 +++++ tests/fsharp/typecheck/sigs/neg07.bsl | 3 - tests/fsharp/typecheck/sigs/neg113.bsl | 9 +- tests/fsharp/typecheck/sigs/neg113.vsbsl | 9 +- tests/fsharp/typecheck/sigs/neg15.bsl | 62 +------------ tests/fsharp/typecheck/sigs/neg16.bsl | 11 ++- tests/fsharp/typecheck/sigs/neg20.bsl | 88 +++++++++++++------ tests/fsharp/typecheck/sigs/neg28.bsl | 64 +++++++------- tests/fsharp/typecheck/sigs/neg32.bsl | 2 +- tests/fsharp/typecheck/sigs/neg37.bsl | 16 ++-- tests/fsharp/typecheck/sigs/neg_anon_1.bsl | 8 +- tests/fsharp/typecheck/sigs/neg_byref_16.bsl | 3 +- tests/fsharp/typecheck/sigs/neg_byref_3.bsl | 2 +- .../fsharp/typecheck/sigs/version50/neg20.bsl | 47 +++++----- 15 files changed, 176 insertions(+), 172 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg04.bsl b/tests/fsharp/typecheck/sigs/neg04.bsl index d077d480f01..3bf91043774 100644 --- a/tests/fsharp/typecheck/sigs/neg04.bsl +++ b/tests/fsharp/typecheck/sigs/neg04.bsl @@ -128,4 +128,4 @@ neg04.fs(159,47,159,57): typecheck error FS0692: This function value is being us neg04.fs(163,54,163,67): typecheck error FS0692: This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking 1 arguments. -neg04.fs(178,13,178,18): typecheck error FS0001: The type '('a -> unit)' does not support the 'equality' constraint because it is a function type +neg04.fs(178,13,178,18): typecheck error FS0001: The type ''a -> unit' does not support the 'equality' constraint because it is a function type diff --git a/tests/fsharp/typecheck/sigs/neg05.bsl b/tests/fsharp/typecheck/sigs/neg05.bsl index 209dc0d9371..7fc02d98e1c 100644 --- a/tests/fsharp/typecheck/sigs/neg05.bsl +++ b/tests/fsharp/typecheck/sigs/neg05.bsl @@ -24,3 +24,25 @@ neg05.fs(57,15,57,18): typecheck error FS1198: The generic member 'Pop' has been neg05.fs(51,11,51,13): typecheck error FS0663: This type parameter has been used in a way that constrains it to always be 'unit' neg05.fs(51,11,51,13): typecheck error FS0660: This code is less generic than required by its annotations because the explicit type variable 'a' could not be generalized. It was constrained to be 'unit'. + +neg05.fs(12,3,12,9): typecheck error FS0842: This attribute cannot be applied to interface. Valid targets are: class, struct, parameter, return value + +neg05.fs(14,5,15,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition + +neg05.fs(17,3,17,8): typecheck error FS0842: This attribute cannot be applied to interface. Valid targets are: class + +neg05.fs(19,5,20,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition + +neg05.fs(24,5,25,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition + +neg05.fs(27,3,27,12): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: interface + +neg05.fs(29,5,30,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition + +neg05.fs(32,3,32,8): typecheck error FS0842: This attribute cannot be applied to struct. Valid targets are: class + +neg05.fs(34,5,35,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition + +neg05.fs(37,3,37,12): typecheck error FS0842: This attribute cannot be applied to struct. Valid targets are: interface + +neg05.fs(39,5,40,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition diff --git a/tests/fsharp/typecheck/sigs/neg07.bsl b/tests/fsharp/typecheck/sigs/neg07.bsl index 3a32ac5abb8..185b6393cfb 100644 --- a/tests/fsharp/typecheck/sigs/neg07.bsl +++ b/tests/fsharp/typecheck/sigs/neg07.bsl @@ -1,6 +1,3 @@ - -neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - neg07.fs(24,13,24,23): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined. Maybe you want one of the following: X.UnionCase1 diff --git a/tests/fsharp/typecheck/sigs/neg113.bsl b/tests/fsharp/typecheck/sigs/neg113.bsl index c9e74bcc6ec..7e47ade2a60 100644 --- a/tests/fsharp/typecheck/sigs/neg113.bsl +++ b/tests/fsharp/typecheck/sigs/neg113.bsl @@ -5,7 +5,7 @@ neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have 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 +neg113.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type '{| b: int |}' is not compatible with type '{| a: int |}' @@ -13,12 +13,11 @@ is not compatible with type 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 +neg113.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type '{| a: int; b: int |}' is not compatible with type '{| 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 -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 - -neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface +neg113.fs(20,42,20,44): 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 c9e74bcc6ec..409745ea3e8 100644 --- a/tests/fsharp/typecheck/sigs/neg113.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg113.vsbsl @@ -5,7 +5,7 @@ neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have 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 +neg113.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type '{| b: int |}' is not compatible with type '{| a: int |}' @@ -13,12 +13,13 @@ is not compatible with type 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 +neg113.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type '{| a: int; b: int |}' is not compatible with type '{| 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 +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 + +neg113.fs(20,42,20,44): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg113.fs(20,42,20,44): 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/neg15.bsl b/tests/fsharp/typecheck/sigs/neg15.bsl index 3089124970c..ba4e25a63f7 100644 --- a/tests/fsharp/typecheck/sigs/neg15.bsl +++ b/tests/fsharp/typecheck/sigs/neg15.bsl @@ -1,62 +1,2 @@ -neg15.fs(102,17,102,31): typecheck error FS1094: The value 'privateValue' is not accessible from this code location - -neg15.fs(103,18,103,43): typecheck error FS1092: The type 'PrivateUnionType' is not accessible from this code location - -neg15.fs(106,18,106,66): typecheck error FS1093: The union cases or fields of the type 'UnionTypeWithPrivateRepresentation' are not accessible from this code location - -neg15.fs(107,17,107,41): typecheck error FS0491: The member or object constructor 'PrivateProperty' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(108,17,108,45): typecheck error FS0491: The member or object constructor 'PrivateStaticProperty' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(109,17,109,41): typecheck error FS0491: The member or object constructor 'PrivateMethod' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(110,17,110,45): typecheck error FS0491: The member or object constructor 'PrivateStaticMethod' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(111,17,111,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location - -neg15.fs(112,18,112,78): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location - -neg15.fs(113,17,113,76): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location - -neg15.fs(114,17,114,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location - -neg15.fs(115,19,115,48): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. - -neg15.fs(116,20,116,73): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. - -neg15.fs(122,32,122,57): typecheck error FS0039: The value, constructor, namespace or type 'InternalTagOfInternalType' is not defined. Maybe you want one of the following: - InternalUnionType - InternalRecordType - DefaultTagOfInternalType - -neg15.fs(128,31,128,61): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. - -neg15.fs(135,31,135,56): typecheck error FS0039: The value, constructor, namespace or type 'InternalTagOfInternalType' is not defined. Maybe you want one of the following: - InternalUnionType - InternalRecordType - DefaultTagOfInternalType - -neg15.fs(141,30,141,60): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. - -neg15.fs(152,20,152,50): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. - -neg15.fs(183,1,183,5): typecheck error FS0491: The member or object constructor 'P' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(184,1,184,7): typecheck error FS0491: The member or object constructor 'M' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(185,1,185,5): typecheck error FS0491: The member or object constructor 'SP' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(186,1,186,7): typecheck error FS0491: The member or object constructor 'SM' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(187,1,187,6): typecheck error FS1096: The record, struct or class field 'f' is not accessible from this code location - -neg15.fs(188,1,188,6): typecheck error FS0491: The member or object constructor 'P' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(189,1,189,8): typecheck error FS0491: The member or object constructor 'M' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(190,1,190,6): typecheck error FS0491: The member or object constructor 'SP' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(191,1,191,8): typecheck error FS0491: The member or object constructor 'SM' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - -neg15.fs(204,11,204,16): typecheck error FS0501: The object constructor 'X2' takes 0 argument(s) but is here given 1. The required signature is 'new: unit -> X2'. +neg15.fs(92,5,92,9): parse error FS0058: Nested type definitions are not allowed. Types must be defined at module or namespace level. diff --git a/tests/fsharp/typecheck/sigs/neg16.bsl b/tests/fsharp/typecheck/sigs/neg16.bsl index 4c2300470f7..dc099968143 100644 --- a/tests/fsharp/typecheck/sigs/neg16.bsl +++ b/tests/fsharp/typecheck/sigs/neg16.bsl @@ -13,9 +13,14 @@ neg16.fs(44,10,44,11): typecheck error FS0934: Records, union, abbreviations and neg16.fs(47,10,47,13): typecheck error FS0934: Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute -neg16.fs(49,7,49,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg16.fs(49,7,49,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, interface + +neg16.fs(49,7,49,23): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, interface + +neg16.fs(52,7,52,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, interface + +neg16.fs(52,7,52,23): typecheck error FS0842: This attribute cannot be applied to method, return value. Valid targets are: class, interface -neg16.fs(52,7,52,23): typecheck error FS0842: This attribute is not valid for use on this language element neg16.fs(59,8,59,17): typecheck error FS0001: This expression was expected to have type 'Choice<'a,'b>' @@ -121,4 +126,6 @@ neg16.fs(113,9,113,11): typecheck error FS0879: Volatile fields must be marked ' neg16.fs(116,9,116,10): typecheck error FS0879: Volatile fields must be marked 'mutable' and cannot be thread-static +neg16.fs(119,17,119,18): typecheck error FS0880: Uninitialized 'val' fields must be mutable and marked with the '[]' attribute. Consider using a 'let' binding instead of a 'val' field. + neg16.fs(130,10,130,11): typecheck error FS0935: Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index 5229dcaacf6..9b965cdbbed 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -213,53 +213,91 @@ neg20.fs(190,34,190,39): typecheck error FS0001: This expression was expected to but here has type 'objnull' -neg20.fs(195,5,195,10): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(195,5,195,10): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class -neg20.fs(198,5,198,11): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(195,5,195,10): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class + +neg20.fs(198,5,198,11): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct, parameter, return value neg20.fs(202,7,202,9): typecheck error FS0825: The 'DefaultValue' attribute may only be used on 'val' declarations -neg20.fs(204,5,204,14): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(204,5,204,14): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: interface + +neg20.fs(204,5,204,14): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: interface + +neg20.fs(207,5,207,11): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class + +neg20.fs(207,5,207,11): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class + +neg20.fs(210,5,210,12): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, type parameter + +neg20.fs(210,5,210,12): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, type parameter + +neg20.fs(213,5,213,33): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class + +neg20.fs(213,5,213,33): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class + +neg20.fs(216,5,216,12): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: field + +neg20.fs(216,5,216,12): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: field + +neg20.fs(219,5,219,15): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method + +neg20.fs(219,5,219,15): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method + +neg20.fs(222,5,222,31): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct + +neg20.fs(222,5,222,31): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, struct + +neg20.fs(225,5,225,22): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class + +neg20.fs(225,5,225,22): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class + +neg20.fs(228,5,228,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct + +neg20.fs(228,5,228,23): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, struct + +neg20.fs(231,5,231,21): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: parameter -neg20.fs(207,5,207,11): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(231,5,231,21): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: parameter -neg20.fs(210,5,210,12): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(234,5,234,34): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method -neg20.fs(213,5,213,33): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(234,5,234,34): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method -neg20.fs(216,5,216,12): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(237,5,237,34): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method -neg20.fs(219,5,219,15): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(240,5,240,23): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method -neg20.fs(222,5,222,31): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(243,5,243,23): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method -neg20.fs(225,5,225,22): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(243,5,243,23): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method -neg20.fs(228,5,228,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(249,9,249,27): typecheck error FS0842: This attribute cannot be applied to property, field. Valid targets are: method -neg20.fs(231,5,231,21): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(255,5,255,28): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct -neg20.fs(234,5,234,34): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(255,5,255,28): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, struct -neg20.fs(237,5,237,34): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(258,5,258,38): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: assembly -neg20.fs(240,5,240,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(258,5,258,38): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: assembly -neg20.fs(243,5,243,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(261,5,261,17): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method, property -neg20.fs(249,9,249,27): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(261,5,261,17): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method, property -neg20.fs(255,5,255,28): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(265,5,265,24): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method, property -neg20.fs(258,5,258,38): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(265,5,265,24): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method, property -neg20.fs(261,5,261,17): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(268,5,268,27): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct, enum -neg20.fs(265,5,265,24): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(268,5,268,27): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, struct, enum -neg20.fs(268,5,268,27): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(271,5,271,15): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: assembly, class, struct -neg20.fs(271,5,271,15): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(271,5,271,15): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: assembly, class, struct neg20.fs(278,14,278,95): typecheck error FS0507: No accessible member or object constructor named 'ProcessStartInfo' takes 0 arguments. Note the call to this member also provides 2 named arguments. @@ -338,13 +376,13 @@ neg20.fs(448,30,448,33): typecheck error FS0001: This expression was expected to but here has type 'string' -neg20.fs(477,29,477,62): typecheck error FS0193: Type constraint mismatch. The type +neg20.fs(477,29,477,30): typecheck error FS0193: Type constraint mismatch. The type 'Prim<'m>' is not compatible with type 'IDerivedComparable>' -neg20.fs(478,29,478,61): typecheck error FS0193: Type constraint mismatch. The type +neg20.fs(478,29,478,30): typecheck error FS0193: Type constraint mismatch. The type 'Prim<'m>' is not compatible with type 'IDerivedEquatable>' diff --git a/tests/fsharp/typecheck/sigs/neg28.bsl b/tests/fsharp/typecheck/sigs/neg28.bsl index 3893eaf1fdd..1728d50334c 100644 --- a/tests/fsharp/typecheck/sigs/neg28.bsl +++ b/tests/fsharp/typecheck/sigs/neg28.bsl @@ -11,27 +11,27 @@ neg28.fsx(58,17,58,33): typecheck error FS0001: The type 'System.Type' does not neg28.fsx(59,17,59,37): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(61,40,61,41): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(61,40,61,41): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(62,42,62,43): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(62,42,62,43): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(63,46,63,47): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(63,46,63,47): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(64,50,64,51): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(64,50,64,51): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(65,54,65,55): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(65,54,65,55): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(66,58,66,59): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(66,58,66,59): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(67,62,67,63): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(67,62,67,63): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(68,66,68,67): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(68,66,68,67): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(69,39,69,40): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(69,39,69,40): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(70,17,70,34): typecheck error FS0001: The type '(int -> int)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface +neg28.fsx(70,17,70,34): typecheck error FS0001: The type 'int -> int' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(71,17,71,38): typecheck error FS0001: The type '(int -> int)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface +neg28.fsx(71,17,71,38): typecheck error FS0001: The type 'int -> int' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(79,17,79,39): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface @@ -45,77 +45,77 @@ neg28.fsx(83,21,83,41): typecheck error FS0001: The type 'System.Type' does not neg28.fsx(97,17,97,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(100,35,100,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(100,35,100,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(108,17,108,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(110,35,110,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(110,35,110,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(112,41,112,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(112,41,112,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(119,17,119,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(121,35,121,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(121,35,121,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(123,41,123,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(123,41,123,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(130,17,130,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(132,35,132,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(132,35,132,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(134,41,134,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(134,41,134,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(142,17,142,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(144,35,144,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(144,35,144,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(146,41,146,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(146,41,146,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(154,17,154,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(156,35,156,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(156,35,156,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(158,41,158,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(158,41,158,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(165,17,165,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(166,17,166,42): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(169,35,169,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(169,35,169,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(171,41,171,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(171,41,171,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(180,17,180,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(181,17,181,42): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(184,35,184,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(184,35,184,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(186,41,186,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(186,41,186,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(194,17,194,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(195,17,195,42): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(198,35,198,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(198,35,198,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(200,41,200,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(200,41,200,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(204,17,204,36): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(205,17,205,42): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(208,35,208,36): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(208,35,208,36): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(210,41,210,42): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(210,41,210,42): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(252,17,252,40): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(253,17,253,46): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface -neg28.fsx(256,42,256,43): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(256,42,256,43): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type -neg28.fsx(258,48,258,49): typecheck error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type +neg28.fsx(258,48,258,49): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type neg28.fsx(272,17,272,23): typecheck error FS0001: The type 'X' does not support the 'comparison' constraint because it is a record, union or struct with one or more structural element types which do not support the 'comparison' constraint. Either avoid the use of comparison with this type, or add the 'StructuralComparison' attribute to the type to determine which field type does not support comparison diff --git a/tests/fsharp/typecheck/sigs/neg32.bsl b/tests/fsharp/typecheck/sigs/neg32.bsl index 87fbc723312..6738f8d3c8e 100644 --- a/tests/fsharp/typecheck/sigs/neg32.bsl +++ b/tests/fsharp/typecheck/sigs/neg32.bsl @@ -1,5 +1,5 @@ -neg32.fs(17,11,17,56): typecheck error FS0842: This attribute is not valid for use on this language element +neg32.fs(17,11,17,56): typecheck error FS0842: This attribute cannot be applied to field. Valid targets are: assembly, module, class, struct, enum, constructor, method, property, field, event, interface, parameter, delegate, return value, type parameter neg32.fs(24,15,24,16): typecheck error FS0043: The member or object constructor 'TryParse' does not take 1 argument(s). An overload was found taking 2 arguments. diff --git a/tests/fsharp/typecheck/sigs/neg37.bsl b/tests/fsharp/typecheck/sigs/neg37.bsl index 71065f796f6..88bd2f32dba 100644 --- a/tests/fsharp/typecheck/sigs/neg37.bsl +++ b/tests/fsharp/typecheck/sigs/neg37.bsl @@ -5,18 +5,18 @@ neg37.fs(19,33,19,40): typecheck error FS1125: The instantiation of the generic neg37.fs(19,19,19,22): typecheck error FS0670: This code is not sufficiently generic. The type variable 'T could not be generalized because it would escape its scope. -neg37.fs(24,10,24,37): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity +neg37.fs(24,10,24,11): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints -neg37.fs(24,10,24,37): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints +neg37.fs(24,10,24,11): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity -neg37.fs(30,10,30,37): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity +neg37.fs(30,10,30,11): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints -neg37.fs(30,10,30,37): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints +neg37.fs(30,10,30,11): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity -neg37.fs(36,10,36,37): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity +neg37.fs(36,10,36,11): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints -neg37.fs(36,10,36,37): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints +neg37.fs(36,10,36,11): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity -neg37.fs(42,9,42,36): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity +neg37.fs(42,9,42,10): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints -neg37.fs(42,9,42,36): typecheck error FS0071: Type constraint mismatch when applying the default type 'IEvent<'T>' for a type inference variable. The type 'IEvent<'T>' is not compatible with the type 'System.IComparable<'T>' Consider adding further type constraints +neg37.fs(42,9,42,10): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity diff --git a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl index 1edbabacd8c..4746617eaab 100644 --- a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl +++ b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl @@ -5,7 +5,7 @@ neg_anon_1.fs(7,41,7,52): typecheck error FS0001: This anonymous record should h 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 +neg_anon_1.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type '{| b: int |}' is not compatible with type '{| a: int |}' @@ -13,12 +13,12 @@ is not compatible with type 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 +neg_anon_1.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type '{| a: int; b: int |}' is not compatible with type '{| 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 +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 -neg_anon_1.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface +neg_anon_1.fs(20,42,20,44): 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_byref_16.bsl b/tests/fsharp/typecheck/sigs/neg_byref_16.bsl index 2843736a8f3..b3cfd33a4b0 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_16.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_16.bsl @@ -1,5 +1,6 @@ +neg_byref_16.fs(3,5,3,6): typecheck error FS3301: The function or method has an invalid return type ''a -> bool -> byref * 'a'. This is not permitted by the rules of Common IL. -neg_byref_16.fs(3,5,3,6): typecheck error FS3301: The function or method has an invalid return type '('a -> bool -> byref * 'a)'. This is not permitted by the rules of Common IL. +neg_byref_16.fs(3,33,3,42): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. neg_byref_16.fs(3,33,3,42): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_3.bsl b/tests/fsharp/typecheck/sigs/neg_byref_3.bsl index 05043743640..549f4e523a4 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_3.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_3.bsl @@ -5,6 +5,6 @@ neg_byref_3.fs(2,5,2,8): typecheck error FS0412: A type instantiation involves a neg_byref_3.fs(2,11,2,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg_byref_3.fs(3,5,3,6): typecheck error FS3301: The function or method has an invalid return type '(byref list -> int)'. This is not permitted by the rules of Common IL. +neg_byref_3.fs(3,5,3,6): typecheck error FS3301: The function or method has an invalid return type 'byref list -> int'. This is not permitted by the rules of Common IL. neg_byref_3.fs(3,11,3,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/version50/neg20.bsl b/tests/fsharp/typecheck/sigs/version50/neg20.bsl index 394f7777b2a..7f8adc7fb19 100644 --- a/tests/fsharp/typecheck/sigs/version50/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/version50/neg20.bsl @@ -103,7 +103,6 @@ neg20.fs(80,30,80,39): typecheck error FS0193: Type constraint mismatch. The typ is not compatible with type 'B seq' - neg20.fs(81,34,81,43): typecheck error FS0001: Type mismatch. Expecting a 'A list' but given a @@ -261,53 +260,53 @@ neg20.fs(190,34,190,39): typecheck error FS0001: This expression was expected to but here has type 'objnull' -neg20.fs(195,5,195,10): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(195,5,195,10): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class -neg20.fs(198,5,198,11): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(198,5,198,11): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct, parameter, return value neg20.fs(202,7,202,9): typecheck error FS0825: The 'DefaultValue' attribute may only be used on 'val' declarations -neg20.fs(204,5,204,14): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(204,5,204,14): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: interface -neg20.fs(207,5,207,11): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(207,5,207,11): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class -neg20.fs(210,5,210,12): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(210,5,210,12): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, type parameter -neg20.fs(213,5,213,33): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(213,5,213,33): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class -neg20.fs(216,5,216,12): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(216,5,216,12): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: field -neg20.fs(219,5,219,15): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(219,5,219,15): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method -neg20.fs(222,5,222,31): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(222,5,222,31): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct -neg20.fs(225,5,225,22): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(225,5,225,22): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class -neg20.fs(228,5,228,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(228,5,228,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct -neg20.fs(231,5,231,21): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(231,5,231,21): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: parameter -neg20.fs(234,5,234,34): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(234,5,234,34): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method -neg20.fs(237,5,237,34): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(237,5,237,34): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method -neg20.fs(240,5,240,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(240,5,240,23): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: method -neg20.fs(243,5,243,23): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(243,5,243,23): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method -neg20.fs(249,9,249,27): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(249,9,249,27): typecheck error FS0842: This attribute cannot be applied to property, field. Valid targets are: method -neg20.fs(255,5,255,28): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(255,5,255,28): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct -neg20.fs(258,5,258,38): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(258,5,258,38): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: assembly -neg20.fs(261,5,261,17): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(261,5,261,17): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method, property -neg20.fs(265,5,265,24): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(265,5,265,24): typecheck error FS0842: This attribute cannot be applied to class, struct, enum, interface, delegate. Valid targets are: method, property -neg20.fs(268,5,268,27): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(268,5,268,27): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, struct, enum -neg20.fs(271,5,271,15): typecheck error FS0842: This attribute is not valid for use on this language element +neg20.fs(271,5,271,15): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: assembly, class, struct neg20.fs(278,14,278,95): typecheck error FS0507: No accessible member or object constructor named 'ProcessStartInfo' takes 0 arguments. Note the call to this member also provides 2 named arguments. From f9bd338f17401e58649afc5c1e6c620d7b5ba289 Mon Sep 17 00:00:00 2001 From: majocha <1760221+majocha@users.noreply.github.com> Date: Sun, 12 Oct 2025 13:49:21 +0200 Subject: [PATCH 4/5] fix neg15 --- tests/fsharp/typecheck/sigs/neg15.bsl | 66 ++++++++++++++++++++++++++- tests/fsharp/typecheck/sigs/neg15.fs | 12 ++--- 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg15.bsl b/tests/fsharp/typecheck/sigs/neg15.bsl index ba4e25a63f7..055ddf9fcc3 100644 --- a/tests/fsharp/typecheck/sigs/neg15.bsl +++ b/tests/fsharp/typecheck/sigs/neg15.bsl @@ -1,2 +1,66 @@ -neg15.fs(92,5,92,9): parse error FS0058: Nested type definitions are not allowed. Types must be defined at module or namespace level. +neg15.fs(102,17,102,31): typecheck error FS1094: The value 'privateValue' is not accessible from this code location + +neg15.fs(103,18,103,43): typecheck error FS1092: The type 'PrivateUnionType' is not accessible from this code location + +neg15.fs(106,18,106,66): typecheck error FS1093: The union cases or fields of the type 'UnionTypeWithPrivateRepresentation' are not accessible from this code location + +neg15.fs(107,17,107,41): typecheck error FS0491: The member or object constructor 'PrivateProperty' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(108,17,108,45): typecheck error FS0491: The member or object constructor 'PrivateStaticProperty' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(109,17,109,41): typecheck error FS0491: The member or object constructor 'PrivateMethod' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(110,17,110,45): typecheck error FS0491: The member or object constructor 'PrivateStaticMethod' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(111,17,111,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location + +neg15.fs(111,17,111,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location + +neg15.fs(112,18,112,78): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location + +neg15.fs(112,18,112,78): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location + +neg15.fs(113,17,113,76): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location + +neg15.fs(114,17,114,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location + +neg15.fs(115,19,115,48): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. + +neg15.fs(116,20,116,73): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. + +neg15.fs(122,32,122,57): typecheck error FS0039: The value, constructor, namespace or type 'InternalTagOfInternalType' is not defined. Maybe you want one of the following: + InternalUnionType + InternalRecordType + DefaultTagOfInternalType + +neg15.fs(128,31,128,61): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. + +neg15.fs(135,31,135,56): typecheck error FS0039: The value, constructor, namespace or type 'InternalTagOfInternalType' is not defined. Maybe you want one of the following: + InternalUnionType + InternalRecordType + DefaultTagOfInternalType + +neg15.fs(141,30,141,60): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. + +neg15.fs(152,20,152,50): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. + +neg15.fs(183,1,183,5): typecheck error FS0491: The member or object constructor 'P' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(184,1,184,7): typecheck error FS0491: The member or object constructor 'M' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(185,1,185,5): typecheck error FS0491: The member or object constructor 'SP' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(186,1,186,7): typecheck error FS0491: The member or object constructor 'SM' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(187,1,187,6): typecheck error FS1096: The record, struct or class field 'f' is not accessible from this code location + +neg15.fs(188,1,188,6): typecheck error FS0491: The member or object constructor 'P' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(189,1,189,8): typecheck error FS0491: The member or object constructor 'M' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(190,1,190,6): typecheck error FS0491: The member or object constructor 'SP' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(191,1,191,8): typecheck error FS0491: The member or object constructor 'SM' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + +neg15.fs(204,11,204,16): typecheck error FS0501: The object constructor 'X2' takes 0 argument(s) but is here given 1. The required signature is 'new: unit -> X2'. diff --git a/tests/fsharp/typecheck/sigs/neg15.fs b/tests/fsharp/typecheck/sigs/neg15.fs index a9dbda709fa..7410b4c83ae 100644 --- a/tests/fsharp/typecheck/sigs/neg15.fs +++ b/tests/fsharp/typecheck/sigs/neg15.fs @@ -89,13 +89,13 @@ module M = static member Method34() = noErrorPrivateValueLaterInferredToInvolvePrivateUnionType := [DefaultTagOfPrivateType(3)] static member Method35() = noErrorPrivateValueLaterInferredToInvolveInternalUnionType := [DefaultTagOfInternalType(3)] - type Type with + type Type with - // Check we can access private things from an in-file augmentation - member x.NoError51 = x.PrivateProperty - member x.NoError52 = Type.PrivateStaticProperty - static member NoError53 = Type.PrivateStaticProperty - static member NoError54 = Type.PrivateStaticMethod() + // Check we can access private things from an in-file augmentation + member x.NoError51 = x.PrivateProperty + member x.NoError52 = Type.PrivateStaticProperty + static member NoError53 = Type.PrivateStaticProperty + static member NoError54 = Type.PrivateStaticMethod() module N = From a2f2da4365613ef8f001a07c99b1cf2f42961b7c Mon Sep 17 00:00:00 2001 From: majocha <1760221+majocha@users.noreply.github.com> Date: Sun, 12 Oct 2025 13:58:25 +0200 Subject: [PATCH 5/5] fix --- tests/fsharp/typecheck/sigs/neg15.bsl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg15.bsl b/tests/fsharp/typecheck/sigs/neg15.bsl index 055ddf9fcc3..3089124970c 100644 --- a/tests/fsharp/typecheck/sigs/neg15.bsl +++ b/tests/fsharp/typecheck/sigs/neg15.bsl @@ -15,10 +15,6 @@ neg15.fs(110,17,110,45): typecheck error FS0491: The member or object constructo neg15.fs(111,17,111,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location -neg15.fs(111,17,111,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location - -neg15.fs(112,18,112,78): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location - neg15.fs(112,18,112,78): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location neg15.fs(113,17,113,76): typecheck error FS1093: The union cases or fields of the type 'RecordTypeWithPrivateRepresentation' are not accessible from this code location