Field in a record named the same as a DUs case inside of module of the same name of the record type fails to pattern match
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
Hello
**Repro steps**
Provide the steps required to reproduce the problem:
```fs
module Test =
type Configuration =
{
Parameters : string list
}
module Configuration =
type Parameters = Parameters of int list
let echo (value : Test.Configuration.Parameters) =
match value with
| Test.Configuration.Parameters i -> i
```

**Expected behavior**
Should not confuse the types
**Actual behavior**
Type confusion is occuring
**Known workarounds**
1. Changing either name of the record property or the DUs case fix the issue.
2. Using an alias, for accessing the DUs:
```fs
module Test =
type Configuration =
{
// Changing this property name fix the issue
Parameters : string list
}
module Configuration =
type Parameters = Parameters of int list
type P = Test.Configuration.Parameters
let echo (value : Test.Configuration.Parameters) =
match value with
| P.Parameters i -> i
```
**Related information**
Provide any related information (optional):
* Operating system: **Windows_NT**
* Runtime: **netcore**
* Dotnet version: **9.0.103**
* VSCode: **1.97.2**
Contributor guide
Assessment
This issue has not been assessed yet.