Uh oh!
There was an error while loading. Please reload this page.
FCS: Enable error reporting with correct file name - #14556
Conversation
T-Gro
commented
Jan 10, 2023
I know it probably isn't a big deal, but I would prefer if this would be done without breaking binary compatibility. (in this case the code overhead is negligable) |
@T-Gro sure , I can change the PR. I was not sure how to best expose the |
T-Gro
commented
Jan 12, 2023
Yep. Because adding an optional member to existing functionality requires recompilation (with no code changes on consumer side), but is binary breaking. A new overload would keep existing usages working. |
KevinRansom
left a comment
There was a problem hiding this comment.
As Tomas says, overloads are preferred for compatibility.
Uh oh!
There was an error while loading. Please reload this page.
ef9bed6 to
909b6f5Comparegoswinr
commented
Jan 14, 2023
@T-Gro , @KevinRansom I changed it to overloads. I also rebased it to use the new basline files for the API surface. the new overloads are: memberEvalInteraction:code:string * scriptFileName: string * ?cancellationToken: CancellationToken -> unitmember EvalInteractionNonThrowing: code: string * scriptFileName: string * ?cancellationToken: CancellationToken -> Choice<FsiValue option, exn>* FSharpDiagnostic[]member EvalExpression: code: string * scriptFileName: string -> FsiValue optionmember EvalExpressionNonThrowing: code: string * scriptFileName: string -> Choice<FsiValue option, exn>* FSharpDiagnostic[]the existing ones: memberEvalInteraction:code:string * ?cancellationToken: CancellationToken -> unitmember EvalInteractionNonThrowing: code: string * ?cancellationToken: CancellationToken -> Choice<FsiValue option, exn>* FSharpDiagnostic[]member EvalExpression: code: string -> FsiValue optionmember EvalExpressionNonThrowing: code: string -> Choice<FsiValue option, exn>* FSharpDiagnostic[]In my own tests the |
goswinr
commented
Feb 1, 2023
Thanks @vzarytovskii ! Is there also some fcs documentation to update ? |
vzarytovskii
commented
Feb 1, 2023
I don't think there's, docs should be automatically generated |
goswinr
commented
Feb 15, 2023
Thanks for merging @vzarytovskii ! However, I did not find this in the new Nuget that was published yesterday. |
vzarytovskii
commented
Feb 15, 2023
I don't think it made it to .200, it should be in the next .300 preview or our preview nuget feed. |

Currently, compiler errors in fsi evaluations via FCS always report an error in a file called
input.fsx.This pull request adds an
optional parameteroverload that allows specifying a filename related to an evaluated string.For example, calling
fsiSession.EvalInteraction( "1 + 1.0" )reportsinput.fsx (1,3)-(1,4) typecheck error The type 'float' does not match the type 'int'But the actual file where this string comes from might be named differently.
I don't want to use
fsiSession.EvalScript(path)since a file might not exist yet, or I might not be evaluating all lines of the current file.