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.
The code to reproduce is available here (https://github.com/swlaschin/ImpossibleCompilerError) and can be reproduced in a small module (MyModule.fs)
No compiler error!
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)
Replace triple-slash doc strings with double-slash comment when the error occurs.
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" :)
I sent a PR in https://github.com/Microsoft/visualfsharp/pull/1145
That was quick. Thanks!
Most helpful comment
Wow. Creating impossible compiler errors. @swlaschin achievement unlocked.