Open KevinRansom opened 2 years ago
This is really weird. I can't repro it outside this particular place in https://github.com/dotnet/fsharp/pull/14383 where it initially appeared.
Also seems like this:
let executeInteraction dbgBreak dir (filename: string) topLine text =
let foo = text.ToString() // Calling ToString out of the interpolated string does not help
let interaction = $"""
#silentCd @"{dir}";;
{if dbgBreak then "#dbgbreak" else ""}
#{topLine} @"{filename}"
{foo};;
#1 "stdin"
;;
"""
does not help i.e. it still shows the same error, but this:
let executeInteraction dbgBreak dir (filename: string) topLine text =
let foo = "\n" + text // Prepending newline to `text` and removing newline from interpolated string helps
let interaction = $"""
#silentCd @"{dir}";;
{if dbgBreak then "#dbgbreak" else ""}
#{topLine} @"{filename}"{foo};;
#1 "stdin"
;;
"""
actually works...
Btw, this error might be relevant:
Looks like an issue with parsing
In this PR: https://github.com/dotnet/fsharp/pull/14383 an additional (highly suspect .ToString() was need to get it to compile.
Without ToString(): With ToString():
For the non-ToString() version the compiler produces this: