-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In FSI, an invalid string literal can break further parsing of string in that interactive session #14160
Comments
I think I incidentally stumbled upon a solution as I've been working on lexing recently, so I am looking into this issue. No clue how to unit test this yet though. |
I have a similiar behavior (broker parsing) that doesn't involve "{", should I open a different issue ? let cst = "Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@37d688b1-org.sonar.scanner.bootstrap.ScannerPluginRepository': Initialization of bean failed" Send it 4 times to FSI
FSI Microsoft (R) F# Interactive version 12.5.0.0 for F# 7.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> # silentCd @"/home/vince/src/github/mrluje/fs-gitlab-stats";;
- # 1 @"/home/vince/src/github/mrluje/fs-gitlab-stats/test.fsx"
- ;;
> let cst = "Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@37d688b1-org.sonar.scanner.bootstrap.ScannerPluginRepository': Initialization of bean failed";;
val cst: string = "Error creating bean with name 'org.sonarsource.scanner.api.in"+[119 chars]
> let cst = "Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@37d688b1-org.sonar.scanner.bootstrap.ScannerPluginRepository': Initialization of bean failed";;
val cst: string = "Error creating bean with name 'org.sonarsource.scanner.api.in"+[119 chars]
> ";; cst = "Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@37d688b1-org.sonar.scanner.bootstrap.ScannerPluginRepository': Initialization of bean faile
- let cst = "Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@37d688b1-org.sonar.scanner.bootstrap.ScannerPluginRepository': Initialization of bean faile
error FS0193: Operation is not supported on this platform.
> ";;
- |
@MrLuje how are you sending the input to FSI in your example? Because it looks like the input got mangled the third time it was sent. Does not seem to be the same issue. |
@abonie with ionide extension (v7.7.0) on vscode with either "FSI: send selection" or "FSI: send line" |
Hmm... It does not repro for me at least on the same version of ionide |
I didn't check before but it looks like it is only failing from WSL $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
$ uname -a
Linux HVS-PF346A2W 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux I can't reproduce it either from windows |
@abonie : Is this still relevant? |
In FSI, inputting an interpolated string literal that opens interpolation expression with
{
but does not close it, e.g.$"{"
breaks the session in a way that further valid string literals can no longer be parsedRepro steps
In
dotnet fsi
try:followed by any(?) string literal, e.g. empty string:
Full session example:
Note: the invalid input results in "error FS3373: Invalid interpolated string", however not all inputs that result in this particular error are followed by this buggy behavior, e.g.
$"{""}"
or$"{"}"
result in error FS3373, but don't break the session.Expected behavior
Valid string literals are parsed correctly, regardless of erroneous input that happened earlier in that same interactive session.
Actual behavior
Certain inputs make FSI unable to parse valid strings afterwards.
Known workarounds
Close FSI session and open a new one
Related information
Provide any related information (optional):
7.0.100-rc.2.22477.23
The text was updated successfully, but these errors were encountered: