dotnet / dotnet/docfx

[Bug] IndexOutOfRangeException with FSharp assembly active pattern

Open
#10,155 0 comments 0 reactions 0 assignees View on GitHub
dotnet
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Describe the bug**
Attempting to generate docs against an fsharp assembly with a particular shape of active pattern throws an exception. I created a minimum reproduction https://github.com/MadelineRitchie/docfx-exception-repro and the code that causes docfx to fail is there in `src/lib/Library.fs`

**To Reproduce**
Steps to reproduce the behavior:
1. Clone my minimum repro https://github.com/MadelineRitchie/docfx-exception-repro
2. `cd src/docfx`
3. `docfx.exe .\docfx.json --serve`

**Expected behavior**
Doc output should be generated.

**Context (please complete the following information):**
- OS: Windows
- Docfx versions tested:
1. 2.77.0+bd00e2b93951e9e7fa6e5abd990d2cd77d7a83bd
2. docfx repo main built locally as of half an hour ago

**Additional context**
The full console output is in the repro repo at https://github.com/MadelineRitchie/docfx-exception-repro/blob/main/console-output-with-error.txt

I ran docfx with a debugger attached, and this particular FSharp output fails the Debug.Assert in SpecIdHelper.cs at line 49 which currently looks like `Debug.Assert(symbol.TypeParameters.Length > int.Parse(match.Value.Substring(2)));`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.