From 1ccbdd446fb9f7997a4152d5c88a5f4b21cd052f Mon Sep 17 00:00:00 2001 From: Isaac Abraham Date: Sun, 22 Dec 2024 14:56:34 +0000 Subject: [PATCH 1/2] Make nullness equivalent warning message clearer. --- src/Compiler/Driver/CompilerDiagnostics.fs | 5 ++--- src/Compiler/FSStrings.resx | 2 +- src/Compiler/xlf/FSStrings.cs.xlf | 4 ++-- src/Compiler/xlf/FSStrings.de.xlf | 4 ++-- src/Compiler/xlf/FSStrings.es.xlf | 4 ++-- src/Compiler/xlf/FSStrings.fr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.it.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ja.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ko.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pl.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pt-BR.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ru.xlf | 4 ++-- src/Compiler/xlf/FSStrings.tr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 4 ++-- .../Language/Nullness/NullableCsharpImportTests.fs | 14 +++++++------- .../Nullness/NullableReferenceTypesTests.fs | 6 +++--- .../library-functions.fs.checknulls_on.err.bsl | 6 +++--- 18 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 83554e74834..9dcf0b72ea3 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -438,7 +438,7 @@ module OldStyleMessages = let ConstraintSolverTupleDiffLengthsE () = Message("ConstraintSolverTupleDiffLengths", "%d%d") let ConstraintSolverInfiniteTypesE () = Message("ConstraintSolverInfiniteTypes", "%s%s") let ConstraintSolverMissingConstraintE () = Message("ConstraintSolverMissingConstraint", "%s") - let ConstraintSolverNullnessWarningEquivWithTypesE () = Message("ConstraintSolverNullnessWarningEquivWithTypes", "%s%s") + let ConstraintSolverNullnessWarningEquivWithTypesE () = Message("ConstraintSolverNullnessWarningEquivWithTypes", "%s") let ConstraintSolverNullnessWarningWithTypesE () = Message("ConstraintSolverNullnessWarningWithTypes", "%s%s") let ConstraintSolverNullnessWarningWithTypeE () = Message("ConstraintSolverNullnessWarningWithType", "%s") let ConstraintSolverNullnessWarningE () = Message("ConstraintSolverNullnessWarning", "%s") @@ -678,8 +678,7 @@ type Exception with let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(ConstraintSolverNullnessWarningEquivWithTypesE().Format t1 t2) - |> ignore + os.Append(ConstraintSolverNullnessWarningEquivWithTypesE().Format t1) |> ignore if m.StartLine <> m2.StartLine then os.Append(SeeAlsoE().Format(stringOfRange m)) |> ignore diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 383b4991105..e9338b6b990 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -130,7 +130,7 @@ A type parameter is missing a constraint '{0}' - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. Nullness warning: The types '{0}' and '{1}' do not have compatible nullability. diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 20b53f76f45..619b9fe496c 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index f58d3a4711d..ab005c186a2 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 88a130d699d..216bcbd2058 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 7d7badde4ed..fc4934ee452 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index f43c8e77851..f62681c6c00 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 6f0a3a978e9..2dc5f27999f 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 43e0a0f1739..b31de25c1f6 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 3096fca8dbf..4962e60bc7c 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index ea48f4c3545..0e86d5e1050 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 7cb20b5e8de..47f804c5ca8 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 9c65fabe248..9802e647aed 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index c895f08ec60..67b116a283e 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index d81a539866e..9cb4a82882d 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs index 5a4f3dedf10..bb67476cb9f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs @@ -107,9 +107,9 @@ let y:System.Collections.Generic.LinkedListNode = ll.First |> shouldFail |> withDiagnostics [ Error 3261, Line 4, Col 59, Line 4, Col 66, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have compatible nullability." - Error 3261, Line 4, Col 59, Line 4, Col 66, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have equivalent nullability." + Error 3261, Line 4, Col 59, Line 4, Col 66, "Nullness warning: A non-nullable 'System.Collections.Generic.LinkedListNode' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." Error 3261, Line 5, Col 59, Line 5, Col 67, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have compatible nullability." - Error 3261, Line 5, Col 59, Line 5, Col 67, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have equivalent nullability."] + Error 3261, Line 5, Col 59, Line 5, Col 67, "Nullness warning: A non-nullable 'System.Collections.Generic.LinkedListNode' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." ] [] let ``Nullable directory info show warn on prop access`` () = @@ -219,12 +219,12 @@ let ``Consumption of nullable C# - no generics, just strings in methods and fiel |> shouldFail |> withDiagnostics [ Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability." - Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Error 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." + Error 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." Error 3261, Line 16, Col 35, Line 16, Col 39, "Nullness warning: The type 'string' does not support 'null'." - Error 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Error 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Error 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." + Error 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." + Error 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs index 55a76b6f522..819bd475152 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs @@ -213,7 +213,7 @@ Test.XString("x":(string|null)) Error 3261, Line 11, Col 6, Line 11, Col 7, "Nullness warning: The type 'obj | null' supports 'null' but a non-null type is expected." Error 3261, Line 11, Col 1, Line 11, Col 8, "Nullness warning: The types 'obj' and 'obj | null' do not have compatible nullability." Error 3261, Line 12, Col 14, Line 12, Col 18, "Nullness warning: The type 'string' does not support 'null'." - Error 3261, Line 13, Col 14, Line 13, Col 31, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 13, Col 14, Line 13, Col 31, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] let ``Typar infered to nonnull obj`` () = @@ -256,7 +256,7 @@ let nonStrictFunc(x:string | null) = strictFunc(x) |> typeCheckWithStrictNullness |> shouldFail |> withDiagnostics [ - Error 3261, Line 4, Col 49, Line 4, Col 50, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 4, Col 49, Line 4, Col 50, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] let ``Can have nullable prop of same type T within a custom type T``() = @@ -994,7 +994,7 @@ let thisShouldAlsoWarn = MyRecord.Create(maybeNull) |> shouldFail |> withDiagnostics [Error 3261, Line 7, Col 38, Line 7, Col 42, "Nullness warning: The type 'string' does not support 'null'." - Error 3261, Line 9, Col 42, Line 9, Col 51, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 9, Col 42, Line 9, Col 51, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl index a74b139264c..ea54d923fc5 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl @@ -4,10 +4,10 @@ library-functions.fs (7,33)-(7,35) typecheck error Value known to be without nul library-functions.fs (8,18)-(8,20) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. library-functions.fs (10,28)-(10,39) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. library-functions.fs (11,18)-(11,26) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. -library-functions.fs (17,27)-(17,38) typecheck error Nullness warning: The types 'String' and 'String | null' do not have equivalent nullability. -library-functions.fs (18,28)-(18,39) typecheck error Nullness warning: The types 'String' and 'String | null' do not have equivalent nullability. +library-functions.fs (17,27)-(17,38) typecheck error Nullness warning: A non-nullable String was expected but this expression is nullable, which is not permitted. Consider either changing the target to be a nullable String, or use pattern matching to safely handle the null case. +library-functions.fs (18,28)-(18,39) typecheck error Nullness warning: A non-nullable String was expected but this expression is nullable, which is not permitted. Consider either changing the target to be a nullable String, or use pattern matching to safely handle the null case. library-functions.fs (20,28)-(20,36) typecheck error Nullness warning: The type 'String | null' supports 'null' but a non-null type is expected. library-functions.fs (26,17)-(26,19) typecheck error Nullness warning: The type 'string' does not support 'null'. library-functions.fs (27,10)-(27,16) typecheck error Nullness warning: The type 'String' does not support 'null'. -library-functions.fs (37,17)-(37,21) typecheck error Nullness warning: The types 'String' and 'string | null' do not have equivalent nullability. +library-functions.fs (37,17)-(37,21) typecheck error Nullness warning: A non-nullable String was expected but this expression is nullable, which is not permitted. Consider either changing the target to be a nullable String, or use pattern matching to safely handle the null case. library-functions.fs (41,26)-(41,28) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. \ No newline at end of file From 36d1257263e118de001ce5df5e240c2ede659763 Mon Sep 17 00:00:00 2001 From: Isaac Abraham Date: Mon, 23 Dec 2024 12:21:52 +0000 Subject: [PATCH 2/2] Update BSL --- .../Nullness/library-functions.fs.checknulls_on.err.bsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl index ea54d923fc5..026cfabacff 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl @@ -4,10 +4,10 @@ library-functions.fs (7,33)-(7,35) typecheck error Value known to be without nul library-functions.fs (8,18)-(8,20) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. library-functions.fs (10,28)-(10,39) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. library-functions.fs (11,18)-(11,26) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. -library-functions.fs (17,27)-(17,38) typecheck error Nullness warning: A non-nullable String was expected but this expression is nullable, which is not permitted. Consider either changing the target to be a nullable String, or use pattern matching to safely handle the null case. -library-functions.fs (18,28)-(18,39) typecheck error Nullness warning: A non-nullable String was expected but this expression is nullable, which is not permitted. Consider either changing the target to be a nullable String, or use pattern matching to safely handle the null case. +library-functions.fs (17,27)-(17,38) typecheck error Nullness warning: A non-nullable 'String' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. +library-functions.fs (18,28)-(18,39) typecheck error Nullness warning: A non-nullable 'String' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. library-functions.fs (20,28)-(20,36) typecheck error Nullness warning: The type 'String | null' supports 'null' but a non-null type is expected. library-functions.fs (26,17)-(26,19) typecheck error Nullness warning: The type 'string' does not support 'null'. library-functions.fs (27,10)-(27,16) typecheck error Nullness warning: The type 'String' does not support 'null'. -library-functions.fs (37,17)-(37,21) typecheck error Nullness warning: A non-nullable String was expected but this expression is nullable, which is not permitted. Consider either changing the target to be a nullable String, or use pattern matching to safely handle the null case. +library-functions.fs (37,17)-(37,21) typecheck error Nullness warning: A non-nullable 'String' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. library-functions.fs (41,26)-(41,28) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. \ No newline at end of file