From 3581b2f8d559f0694b6434b78484f2c1dcbe6474 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 8 Aug 2024 10:21:38 +0200 Subject: [PATCH 1/3] Pass SynPat.Typed nodes to original continuation. --- .../GraphChecking/FileContentMapping.fs | 2 +- .../TypeChecks/Graph/Scenarios.fs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs index 271e927933a..13ee0c312f9 100644 --- a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs +++ b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs @@ -598,7 +598,7 @@ let visitPat (p: SynPat) : FileContentEntry list = match p with | NameofPat moduleNameIdent -> continuation [ visitNameofResult moduleNameIdent ] | SynPat.Paren(pat = pat) -> visit pat continuation - | SynPat.Typed(pat = pat; targetType = t) -> visit pat (fun nodes -> nodes @ visitSynType t) + | SynPat.Typed(pat = pat; targetType = t) -> visit pat (fun nodes -> nodes @ visitSynType t |> continuation) | SynPat.Const _ -> continuation [] | SynPat.Wild _ -> continuation [] | SynPat.Named _ -> continuation [] diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs index 6bd170a9dbf..fe0c270edc5 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs @@ -1022,4 +1022,24 @@ module Program = """ (set [| 0 |]) ] + scenario + "fully qualified type in tuple constructor pattern" + [ + sourceFile + "A.fs" + """ +namespace MyRootNamespace.A + +type Foo() = class end +""" + Set.empty + sourceFile + "B.fs" + """ +namespace MyRootNamespace.A.B + +type Bar(foo: MyRootNamespace.A.Foo, s: string) = class end +""" + (set [| 0 |]) + ] ] \ No newline at end of file From d3306ee4e513865047201be2dd6ca23d62849752 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 8 Aug 2024 10:30:39 +0200 Subject: [PATCH 2/3] Add release note --- docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 99c251d76c2..b681c475043 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -5,6 +5,7 @@ * Optimize simple mappings in comprehensions when the body of the mapping has `let`-bindings and/or sequential expressions before a single yield. ([PR #17419](https://github.com/dotnet/fsharp/pull/17419)) * C# protected property can be assigned in F# inherit constructor call. ([Issue #13299](https://github.com/dotnet/fsharp/issues/13299), [PR #17391](https://github.com/dotnet/fsharp/pull/17391)) * MethodAccessException on equality comparison of a record with private fields. ([Issue #17447](https://github.com/dotnet/fsharp/issues/17447), [PR #17391](https://github.com/dotnet/fsharp/pull/17467)) +* Compiler fails to recognise namespace in FQN with enabled GraphBasedChecking. ([Issue #17508](https://github.com/dotnet/fsharp/issues/17508), [PR #17510](https://github.com/dotnet/fsharp/pull/17510)) ### Added From 0a542e8621d5088c0e1908eac4e65d359d98bb27 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 8 Aug 2024 13:18:44 +0200 Subject: [PATCH 3/3] Trigger CI