Skip to content
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

Some warnings may be discarded using #load with forward slash path separators #1240

Open
taylorwood opened this issue Jun 3, 2016 · 0 comments
Labels
Area-FSI Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@taylorwood
Copy link
Contributor

I noticed this issue while reproducing #1126: using forward slashes in the path for #load "c:/temp/nada.fsx" suppressed the warning in FSI when it seems it shouldn't have.

https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/CompileOps.fs#L5001
The file path comparison doesn't "normalize" the path separators, so rootFilename still has forward slashes while m.FileName doesn't, and warnings later get filtered by isRootRange.

Repro steps

To reproduce, create a file, say C:\temp\nada.fsx containing

#nowarn "211"
#I "totally-non-existing-folder"

And then run the following in F# Interactive:

> #load "C:/temp/nada.fsx";;

Expected behavior

> #load "C:/temp/nada.fsx";;

[Loading C:\temp\nada.fsx]
C:\temp\nada.fsx(2,1): warning FS0211: The search directory 
    'C:\temp\totally-non-existing-folder' could not be found
namespace FSI_0002

I think the warning should've (erroneously, according to #1126 and #1239) appeared whether using backward or forward slashes with #load.

Actual behavior

> #load "C:/temp/nada.fsx";;

[Loading C:\temp\nada.fsx]

namespace FSI_0002

Warning doesn't appear as it does when using backslashes in path.

Known workarounds

Don't use forward slashes in #load paths.

Related information

The repro steps for this issue will no longer work if #1239 is merged, but I think the issue will still exist.

  • Windows 10.0.10586
  • master branch
  • .NET 4
  • Low severity?
@dsyme dsyme added Bug Area-LangService-API Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. labels Jun 28, 2016
@cartermp cartermp added this to the Unknown milestone Aug 25, 2018
@cartermp cartermp modified the milestones: Unknown / not bug, Backlog May 23, 2019
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
@vzarytovskii vzarytovskii reopened this Jan 5, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in F# Compiler and Tooling Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FSI Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Archived in project
Development

No branches or pull requests

5 participants