From e59d9a3e5a46186829d3c3352f375a5f17e6e42b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:26:59 +0000 Subject: [PATCH 1/8] Initial plan From d90d4de181ddfb6c3de978e0274f8be06c3250bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:02:26 +0000 Subject: [PATCH 2/8] Add CheckNamespaceModuleOrTypeName validation for exception names and initial tests Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- src/Compiler/Checking/CheckDeclarations.fs | 1 + .../E_IllegalCharacters01.fsx | 8 ++ .../E_IllegalCharacters02.fsx | 8 ++ .../E_IllegalCharacters03.fsx | 8 ++ .../E_IllegalCharacters04.fsx | 8 ++ .../E_IllegalCharacters05.fsx | 8 ++ .../E_IllegalCharacters06.fsx | 7 ++ .../ExceptionDefinitions.fs | 81 +++++++++++++++++++ .../LegalExceptionNames.fsx | 20 +++++ 9 files changed, 149 insertions(+) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters06.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/LegalExceptionNames.fsx diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index adcd4d80f30..07b40b6b119 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -2406,6 +2406,7 @@ module TcExceptionDeclarations = let TcExnDefnCore_Phase1A g cenv env parent (SynExceptionDefnRepr(Attributes synAttrs, SynUnionCase(ident= SynIdent(id,_)), _, xmlDoc, vis, m)) = let attrs = TcAttributes cenv env AttributeTargets.ExnDecl synAttrs if not (String.isLeadingIdentifierCharacterUpperCase id.idText) then errorR(NotUpperCaseConstructor id.idRange) + CheckNamespaceModuleOrTypeName g id let vis, cpath = ComputeAccessAndCompPath g env None m vis None parent let vis = TcRecdUnionAndEnumDeclarations.CombineReprAccess parent vis CheckForDuplicateConcreteType env (id.idText + "Exception") id.idRange diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx new file mode 100644 index 00000000000..946133faafc --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx @@ -0,0 +1,8 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Exception names must not contain illegal characters + +#light + +exception My.Exception // err: contains '.' +exception My+Exception // err: contains '+' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx new file mode 100644 index 00000000000..d19801abdb2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx @@ -0,0 +1,8 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Exception names must not contain illegal characters + +#light + +exception My$Exception // err: contains '$' +exception My&Exception // err: contains '&' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx new file mode 100644 index 00000000000..99e6f6294eb --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx @@ -0,0 +1,8 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Exception names must not contain illegal characters + +#light + +exception My[Exception // err: contains '[' +exception My]Exception // err: contains ']' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx new file mode 100644 index 00000000000..497f678338b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx @@ -0,0 +1,8 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Exception names must not contain illegal characters + +#light + +exception My/Exception // err: contains '/' +exception My\Exception // err: contains '\' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx new file mode 100644 index 00000000000..46442a03abb --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx @@ -0,0 +1,8 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Exception names must not contain illegal characters + +#light + +exception My*Exception // err: contains '*' +exception ``My"Exception`` // err: contains '"' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters06.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters06.fsx new file mode 100644 index 00000000000..d649125fa29 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters06.fsx @@ -0,0 +1,7 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Exception names must not contain illegal characters + +#light + +exception ``My`Exception`` // err: contains '`' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs index 1ec630b6e98..b0ae2f5223d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs @@ -385,3 +385,84 @@ module ExceptionDefinition = |> withOptions ["--warnaserror+"; "--nowarn:988"] |> compileExeAndRun |> shouldSucceed + + // Test cases for illegal characters in exception names + // SOURCE=E_IllegalCharacters01.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters01.fsx + [] + let``E_IllegalCharacters01_fsx`` compilation = + compilation + |> asExe + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + ] + + // SOURCE=E_IllegalCharacters02.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters02.fsx + [] + let``E_IllegalCharacters02_fsx`` compilation = + compilation + |> asExe + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + ] + + // SOURCE=E_IllegalCharacters03.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters03.fsx + [] + let``E_IllegalCharacters03_fsx`` compilation = + compilation + |> asExe + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + ] + + // SOURCE=E_IllegalCharacters04.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters04.fsx + [] + let``E_IllegalCharacters04_fsx`` compilation = + compilation + |> asExe + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + ] + + // SOURCE=E_IllegalCharacters05.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters05.fsx + [] + let``E_IllegalCharacters05_fsx`` compilation = + compilation + |> asExe + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") + ] + + // SOURCE=E_IllegalCharacters06.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters06.fsx + [] + let``E_IllegalCharacters06_fsx`` compilation = + compilation + |> asExe + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") + ] + + // SOURCE=LegalExceptionNames.fsx # LegalExceptionNames.fsx + [] + let``LegalExceptionNames_fsx`` compilation = + compilation + |> asExe + |> withOptions ["--warnaserror+"; "--nowarn:988"] + |> compileExeAndRun + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/LegalExceptionNames.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/LegalExceptionNames.fsx new file mode 100644 index 00000000000..e01751b1e34 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/LegalExceptionNames.fsx @@ -0,0 +1,20 @@ +// #Regression #Conformance #TypesAndModules #Exceptions +// Exception types +// Legal exception names should compile successfully + +#light + +exception MyException +exception MyOtherException +exception Exception123 +exception ExceptionWithLongName +exception A + +let test() = + try + raise (MyException) + with + | MyException -> printfn "Caught MyException" + | _ -> printfn "Caught other" + +let () = test() \ No newline at end of file From 8366bea0e362e4f923872dc6e897098c1a38dc8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:09:07 +0000 Subject: [PATCH 3/8] Fix test syntax and update error column positions Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../E_IllegalCharacters02.fsx | 4 ++-- .../E_IllegalCharacters03.fsx | 4 ++-- .../E_IllegalCharacters04.fsx | 4 ++-- .../E_IllegalCharacters05.fsx | 4 ++-- .../ExceptionDefinitions.fs | 21 ++++++++++--------- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx index d19801abdb2..b51f172d988 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters02.fsx @@ -4,5 +4,5 @@ #light -exception My$Exception // err: contains '$' -exception My&Exception // err: contains '&' \ No newline at end of file +exception ``My$Exception`` // err: contains '$' +exception ``My&Exception`` // err: contains '&' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx index 99e6f6294eb..d555dd6ad6a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters03.fsx @@ -4,5 +4,5 @@ #light -exception My[Exception // err: contains '[' -exception My]Exception // err: contains ']' \ No newline at end of file +exception ``My[Exception`` // err: contains '[' +exception ``My]Exception`` // err: contains ']' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx index 497f678338b..6e7ce8566ad 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters04.fsx @@ -4,5 +4,5 @@ #light -exception My/Exception // err: contains '/' -exception My\Exception // err: contains '\' \ No newline at end of file +exception ``My/Exception`` // err: contains '/' +exception ``My\Exception`` // err: contains '\' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx index 46442a03abb..16b3cbb70f0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters05.fsx @@ -4,5 +4,5 @@ #light -exception My*Exception // err: contains '*' -exception ``My"Exception`` // err: contains '"' \ No newline at end of file +exception ``My*Exception`` // err: contains '*' +exception ``My"Exception`` // err: contains '"' \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs index b0ae2f5223d..29ad363c7af 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs @@ -267,6 +267,7 @@ module ExceptionDefinition = |> withDiagnostics [ (Warning 1104, Line 8, Col 11, Line 8, Col 27, "Identifiers containing '@' are reserved for use in F# code generation") (Warning 1104, Line 10, Col 16, Line 10, Col 41, "Identifiers containing '@' are reserved for use in F# code generation") + (Error 883, Line 8, Col 11, Line 8, Col 27, "Invalid namespace, module, type or union case name") (Error 39, Line 10, Col 16, Line 10, Col 41, "The type 'Crazy@name.pException' is not defined. Maybe you want one of the following:\r\n Crazy@name.p") ] @@ -395,8 +396,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters02.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters02.fsx @@ -407,8 +408,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters03.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters03.fsx @@ -419,8 +420,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters04.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters04.fsx @@ -431,8 +432,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters05.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters05.fsx @@ -443,7 +444,7 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 23, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") ] @@ -455,7 +456,7 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 27, "Invalid namespace, module, type or union case name") ] // SOURCE=LegalExceptionNames.fsx # LegalExceptionNames.fsx From 9a169fd73b012602b7ca6023b18c97be68844822 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:18:28 +0000 Subject: [PATCH 4/8] Final fix for test syntax - use backticks for all exception names with illegal characters Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../ExceptionDefinitions/E_IllegalCharacters01.fsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx index 946133faafc..36d06b2f451 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/E_IllegalCharacters01.fsx @@ -4,5 +4,5 @@ #light -exception My.Exception // err: contains '.' -exception My+Exception // err: contains '+' \ No newline at end of file +exception ``My.Exception`` // err: contains '.' +exception ``My+Exception`` // err: contains '+' \ No newline at end of file From 077d5c51c1250b710ac86b6329cac0c5999044b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 22 Jul 2025 11:08:56 +0000 Subject: [PATCH 5/8] Fix test coordinate expectations and add release notes Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- docs/release-notes/.Language/preview.md | 1 + .../ExceptionDefinitions.fs | 20 ++++----- .../_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx | 42 +++++++++++++++++++ .../_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx | 42 +++++++++++++++++++ .../_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx | 42 +++++++++++++++++++ 5 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx create mode 100644 tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx create mode 100644 tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 687402597c5..6f7d55e740b 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -9,6 +9,7 @@ * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Scoped Nowarn: added the #warnon compiler directive ([Language suggestion #278](https://github.com/fsharp/fslang-suggestions/issues/278), [RFC FS-1146 PR](https://github.com/fsharp/fslang-design/pull/782), [PR #18049](https://github.com/dotnet/fsharp/pull/18049)) * Allow `let!` and `use!` type annotations without requiring parentheses. ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) +* Exception names are now validated for illegal characters using the same mechanism as types/modules/namespaces ([Issue #18763](https://github.com/dotnet/fsharp/issues/18763)) ### Fixed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs index 29ad363c7af..01f7d1f1e5b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs @@ -396,8 +396,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 27, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 27, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters02.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters02.fsx @@ -408,8 +408,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 27, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 27, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters03.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters03.fsx @@ -420,8 +420,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 27, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 27, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters04.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters04.fsx @@ -432,8 +432,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 27, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 27, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters05.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters05.fsx @@ -444,8 +444,8 @@ module ExceptionDefinition = |> compile |> shouldFail |> withDiagnostics [ - (Error 883, Line 7, Col 11, Line 7, Col 26, "Invalid namespace, module, type or union case name") - (Error 883, Line 8, Col 11, Line 8, Col 26, "Invalid namespace, module, type or union case name") + (Error 883, Line 7, Col 11, Line 7, Col 27, "Invalid namespace, module, type or union case name") + (Error 883, Line 8, Col 11, Line 8, Col 27, "Invalid namespace, module, type or union case name") ] // SOURCE=E_IllegalCharacters06.fsx SCFLAGS="--test:ErrorRanges" # E_IllegalCharacters06.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx new file mode 100644 index 00000000000..4f91821fda7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) +[xUnit.net 00:00:00.12] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.44] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.45] Starting: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:01.46] FSharp.Compiler.ComponentTests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. + ---> System.Exception: Couldn't find "FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.build/debug/netstandard2.0/fsharp.build.dll". Running 'build test' once might solve this issue + at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 + at TestFramework.requireArtifact@326.Invoke(String path) + at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 336 + at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 + --- End of inner exception stack trace --- + at TestFramework.get_initialConfig() + at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 + at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 + at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 + at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 + at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 + at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 + + + No test matches the given testcase filter `Name~IllegalCharacters` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Debug/net9.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx new file mode 100644 index 00000000000..a4fa5a5ede3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) +[xUnit.net 00:00:00.13] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.46] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.47] Starting: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:01.48] FSharp.Compiler.ComponentTests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. + ---> System.Exception: Couldn't find "FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.build/debug/netstandard2.0/fsharp.build.dll". Running 'build test' once might solve this issue + at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 + at TestFramework.requireArtifact@326.Invoke(String path) + at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 336 + at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 + --- End of inner exception stack trace --- + at TestFramework.get_initialConfig() + at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 + at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 + at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 + at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 + at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 + at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 + + + No test matches the given testcase filter `Name~E_BeginWithUppercase` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Debug/net9.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx new file mode 100644 index 00000000000..a44b2b14e83 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) +[xUnit.net 00:00:00.12] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.32] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.33] Starting: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:01.34] FSharp.Compiler.ComponentTests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. + ---> System.Exception: Couldn't find "FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.build/debug/netstandard2.0/fsharp.build.dll". Running 'build test' once might solve this issue + at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 + at TestFramework.requireArtifact@326.Invoke(String path) + at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 336 + at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 + --- End of inner exception stack trace --- + at TestFramework.get_initialConfig() + at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 + at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 + at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 + at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 + at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 + at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 + + + No test matches the given testcase filter `E_IllegalCharacters01_fsx` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Debug/net9.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file From 5f499d96e7679ab645566ecb99e1863cd16a61f2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 22 Jul 2025 11:14:39 +0000 Subject: [PATCH 6/8] Add TestResults to gitignore to prevent committing test artifacts Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6ca107a5779..e7a2cbc7bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -132,6 +132,7 @@ micro.exe positive.exe /tests/FSharp.Compiler.ComponentTests/FSharpChecker/StandardError.txt /tests/FSharp.Compiler.ComponentTests/FSharpChecker/StandardOutput.txt +/tests/FSharp.Compiler.ComponentTests/TestResults/ # ilverify baseline result files *.bsl.actual From 5b0a147ba3a535b10cb96a4e0fd6a288e109a63a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 24 Jul 2025 07:31:52 +0000 Subject: [PATCH 7/8] Fix failing test case by removing illegal character from exception name and delete test artifacts Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../CompilerDirectives/NonStringArgs.fs | 2 +- .../_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx | 42 ------------------- .../_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx | 42 ------------------- .../_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx | 42 ------------------- 4 files changed, 1 insertion(+), 127 deletions(-) delete mode 100644 tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx delete mode 100644 tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx delete mode 100644 tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs index a28132266be..354d11a1e8b 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs @@ -90,7 +90,7 @@ module NonStringArgs = #nowarn 20 FS1104 "3391" "FS3221" module Exception = - exception ``Crazy@name.p`` of string + exception ``Crazy@name`` of string module Decimal = type T1 = { a : decimal } diff --git a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx deleted file mode 100644 index 4f91821fda7..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_15.trx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) -[xUnit.net 00:00:00.12] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.44] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.45] Starting: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:01.46] FSharp.Compiler.ComponentTests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. - ---> System.Exception: Couldn't find "FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.build/debug/netstandard2.0/fsharp.build.dll". Running 'build test' once might solve this issue - at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 - at TestFramework.requireArtifact@326.Invoke(String path) - at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 336 - at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 - --- End of inner exception stack trace --- - at TestFramework.get_initialConfig() - at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 - at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 - at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 - at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 - at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 - at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 - - - No test matches the given testcase filter `Name~IllegalCharacters` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Debug/net9.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx deleted file mode 100644 index a4fa5a5ede3..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_49_35.trx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) -[xUnit.net 00:00:00.13] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.46] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.47] Starting: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:01.48] FSharp.Compiler.ComponentTests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. - ---> System.Exception: Couldn't find "FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.build/debug/netstandard2.0/fsharp.build.dll". Running 'build test' once might solve this issue - at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 - at TestFramework.requireArtifact@326.Invoke(String path) - at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 336 - at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 - --- End of inner exception stack trace --- - at TestFramework.get_initialConfig() - at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 - at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 - at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 - at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 - at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 - at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 - - - No test matches the given testcase filter `Name~E_BeginWithUppercase` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Debug/net9.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx b/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx deleted file mode 100644 index a44b2b14e83..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/TestResults/_pkrvmq0rgcvqdmg_2025-07-22_10_51_21.trx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-preview.6.25315.102) -[xUnit.net 00:00:00.12] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.32] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.33] Starting: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:01.34] FSharp.Compiler.ComponentTests: Catastrophic failure: System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Test-Utilities>.$TestFramework' threw an exception. - ---> System.Exception: Couldn't find "FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll" on the following paths: "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Build/Debug/netstandard2.0/FSharp.Build.dll", "/home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsharp.build/debug/netstandard2.0/fsharp.build.dll". Running 'build test' once might solve this issue - at TestFramework.requireFile(String dir, String path) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 296 - at TestFramework.requireArtifact@326.Invoke(String path) - at TestFramework.config(String configurationName, FSharpMap`2 envVars) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 336 - at <StartupCode$FSharp-Test-Utilities>.$TestFramework..cctor() in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/TestFramework.fs:line 460 - --- End of inner exception stack trace --- - at TestFramework.get_initialConfig() - at <StartupCode$FSharp-Test-Utilities>.$XunitHelpers.CreateExecutor@198.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/XunitHelpers.fs:line 216 - at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.execution/Sdk/Frameworks/TestFrameworkExecutor.cs:line 100 - at Xunit.Xunit2.RunTests(IEnumerable`1 testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/v2/Xunit2.cs:line 110 - at Xunit.XunitFrontController.RunTests(IEnumerable`1 testMethods, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Frameworks/XunitFrontController.cs:line 185 - at TestFrameworkExtensions.RunTests(ITestFrameworkExecutor executor, IEnumerable`1 testCases, IMessageSinkWithTypes executionMessageSink, ITestFrameworkExecutionOptions executionOptions) in /_/src/xunit.runner.utility/Extensions/TestFrameworkExtensions.cs:line 69 - at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, TestPlatformContext testPlatformContext, RunSettings runSettings, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo) in /_/src/xunit.runner.visualstudio/VsTestRunner.cs:line 555 - - - No test matches the given testcase filter `E_IllegalCharacters01_fsx` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Debug/net9.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file From 796d441aebbcd64b549b88af5950191663d57cc0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 25 Jul 2025 10:00:47 +0000 Subject: [PATCH 8/8] Fix failing test case by adjusting column position for exception name validation Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../CompilerDirectives/NonStringArgs.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs index 354d11a1e8b..a8b275ab3d5 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs @@ -118,7 +118,7 @@ module DoBinding = (Error 3350, Line 2, Col 9, Line 2, Col 11, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") (Error 3350, Line 2, Col 12, Line 2, Col 18, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") (Warning 203, Line 2, Col 26, Line 2, Col 34, "Invalid warning number 'FS3221'") - (Warning 1104, Line 5, Col 15, Line 5, Col 31, "Identifiers containing '@' are reserved for use in F# code generation") + (Warning 1104, Line 5, Col 15, Line 5, Col 29, "Identifiers containing '@' are reserved for use in F# code generation") ] else compileResult