Fsharp: "Internal error FS0192 : impossible" in XmlDocWriter with CSV Type Provider

Created on 2 May 2016  路  5Comments  路  Source: dotnet/fsharp

F# compiler fails with an "FS0192 impossible" compiler error somewhere in the XmlDocWriter logic.

It only occurs in relation to the CSV Type Provider, but even if the TP is buggy, I would not expect this to cause a compiler error.

Repro steps

The code to reproduce is available here (https://github.com/swlaschin/ImpossibleCompilerError) and can be reproduced in a small module (MyModule.fs)

Expected behavior

No compiler error!

Actual behavior

Here's a bit of the stack trace:

error FS0192 : internal error : impossible [\src\ImpossibleCompilerError\ImpossibleCompilerError.fsproj]

 Unhandled Exception: System.Exception: impossible
            at Microsoft.FSharp.Compiler.Tastops.typeEnc(TcGlobals g, FSharpList`1 gtpsType, FSharpList`1 gtpsMethod, TType ty)
            at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x)
            at Microsoft.FSharp.Compiler.Tastops.XmlDocArgsEnc(TcGlobals g, FSharpList`1 gtpsType, FSharpList`1 gtpsMethod, FSharpList`1 argTs)
            at Microsoft.FSharp.Compiler.Tastops.XmlDocSigOfVal(TcGlobals g, String path, Val v)
            at Microsoft.FSharp.Compiler.Driver.XmlDocWriter.doValSig@512(TcGlobals tcGlobals, String ptext, Val v)
            at Microsoft.FSharp.Compiler.Driver.XmlDocWriter.doValSig@512-1.Invoke(String ptext, Val v)
            at Microsoft.FSharp.Primitives.Basics.List.iter[T](FSharpFunc`2 f, FSharpList`1 x)

Known workarounds

Replace triple-slash doc strings with double-slash comment when the error occurs.

Related information

  • Windows 10
  • NET framework: net452
  • F# compiler: v4.0 (Visual Studio 2015)
  • Fsharp.Core: 4.4.0.0
  • FSharp.Data (2.2.5) (also fails with 2.3.0-beta2 )

Most helpful comment

Wow. Creating impossible compiler errors. @swlaschin achievement unlocked.

All 5 comments

Wow. Creating impossible compiler errors. @swlaschin achievement unlocked.

Will take at this tomorrow.

Also, please change the "impossible" error message to read "as likely as 5,000-1 outsiders winning the English Premier League" :)

That was quick. Thanks!

Was this page helpful?
0 / 5 - 0 ratings