Skip to content

Commit

Permalink
Pass SynPat.Typed nodes to original continuation. (#17510)
Browse files Browse the repository at this point in the history
* Pass SynPat.Typed nodes to original continuation.

* Add release note

* Trigger CI
  • Loading branch information
nojaf authored Aug 8, 2024
1 parent 15b5a6c commit b4471a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Driver/GraphChecking/FileContentMapping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down
20 changes: 20 additions & 0 deletions tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 |])
]
]

0 comments on commit b4471a1

Please sign in to comment.