From f1341caea4fbe623d1c72dd7fa546ee411006b2b Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 10 Aug 2022 09:46:39 +1300 Subject: [PATCH] More tests for Lowercase DU when RequireQualifiedAccess --- .../E_LowercaseWhenRequireQualifiedAccess.fsx | 17 ++++++++++++++++- .../LowercaseWhenRequireQualifiedAccess.fsx | 14 ++++++++++++++ .../Conformance/UnionTypes/UnionTypes.fs | 9 +++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx index a7e7a928e3..6c0735e38e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx @@ -19,4 +19,19 @@ type DU6 = a type du1 = du1 of string -type du2 = | du2 of string \ No newline at end of file +type du2 = | du2 of string + +[] +type du3 = + | a + | ``c`` + +[] +type du4 = + | a + | ``a.b`` + +[] +type du5 = + | a + | ``A.C`` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx index e9080c1996..3e02985321 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx @@ -14,6 +14,8 @@ type DU2 = | a of int | B of string | C + | ``D`` of bool + | ``d`` of string * int [] type DU3 = | a @@ -21,6 +23,18 @@ type DU3 = | a [] type DU4 = a +[] +type DU5 = ``a`` + +[] +type DU6 = ``A`` + +[] +type DU7 = | ``a`` + +[] +type DU8 = | ``A`` + [] type du1 = du1 of string diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs index 39f4fac380..7c96b3ff71 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs @@ -543,6 +543,8 @@ module UnionTypes = (Error 53, Line 18, Col 12, Line 18, Col 13, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); (Error 53, Line 20, Col 12, Line 20, Col 15, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); (Error 53, Line 22, Col 14, Line 22, Col 17, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") + (Error 883, Line 32, Col 7, Line 32, Col 14, "Invalid namespace, module, type or union case name"); + (Error 883, Line 37, Col 7, Line 37, Col 14, "Invalid namespace, module, type or union case name") ] //SOURCE=E_LowercaseWhenRequireQualifiedAccess.fsx # E_LowercaseWhenRequireQualifiedAccess.fsx @@ -565,6 +567,13 @@ module UnionTypes = (Error 53, Line 18, Col 12, Line 18, Col 13, "Discriminated union cases and exception labels must be uppercase identifiers"); (Error 53, Line 20, Col 12, Line 20, Col 15, "Discriminated union cases and exception labels must be uppercase identifiers"); (Error 53, Line 22, Col 14, Line 22, Col 17, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 26, Col 7, Line 26, Col 8, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 27, Col 7, Line 27, Col 12, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 31, Col 7, Line 31, Col 8, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 32, Col 7, Line 32, Col 14, "Invalid namespace, module, type or union case name"); + (Error 53, Line 32, Col 7, Line 32, Col 14, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 36, Col 7, Line 36, Col 8, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 37, Col 7, Line 37, Col 14, "Invalid namespace, module, type or union case name") ] //SOURCE=W_GenericFunctionValuedStaticProp02.fs SCFLAGS="--test:ErrorRanges --warnaserror-" # W_GenericFunctionValuedStaticProp02.fs