DefaultAugmentation on DU leads to badly generated type
Open
Area-Compiler-Checking
Bug
Impact-Low
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
I fell into a pit. exp:
Writting a DU in **Liberary1**:
```
[] // focus on it
type Bar =
| Test1 of int
| Test 2
module Bar =
let inline foo x = // focus on "inline"
match x with
| Test1 x -> x
| Test2 -> 0
```
and then write code in **Liberary2**
```
let foo2 x = Bar.foo x
```
As `foo2` is called, some exception is happend.
Because `DefaultAugmentation false` don't generate property `Tag`, the inline function `foo` use `_tag` for judgment. And when we using `Bar.foo` in another liberary, the code inline to `foo2`. It visit `_tag`, bug it's an internal value...
Contributor guide
Assessment
This issue has not been assessed yet.