-
Notifications
You must be signed in to change notification settings - Fork 795
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
FS0039 - not defined - when VS is editing a new solution #8760
Comments
I went through the steps and didn't repro this. If there was a problem I think it's been fixed. |
@dsyme and @cartermp, I am still able to reproduce this in VS 16.8.0 Preview 2.1 and VS 16.7.2, but possibly with a slight change in behaviour since my original report. Rebuilding twice is now a workaround, and I suspect that wasn't the case earlier, but I have no easy way to confirm that now.
edit: Of course this isn't an issue that bothers me at all, but I'm thinking perhaps you might still want it open because it looks like a reliable repro, and can give somebody a grip on the problem if it's worth fixing. |
I will re-open this. Generally speaking there's some issues with "sticky" errors in the error list. C# can similarly have the same issue, making me think this might not be entirely an F# tools thing. |
So a little bit of detail about the general problem space courtesy of @jmarolf
So it's a difficult space when the two error sources are mixed. When Build Only is selected, you'll only see the MSBuild errors and that explains the consistent behavior there. I would expect IntelliSense Only to be consistent, but if it's not then there is likely a subtle bug somewhere on our side. Separately, #6036 may also be related, where a bug in not showing an IntelliSense error masks a build error. So between this, #6036, and #3510 I think we have at least one bug on our end. But we could also be running into the kinds of issues mentioned. |
is this still open, and can it also affect this issue? in that case the build completes, but the VS ide shows FS0039 errors |
It is still a real problem I create an empty file named With code
then open with type into shell
|
Hello @cnmade, This is by design, it has always been the default module name inference for F#, where module names are normally upper case. You can add
at the top of your file |
@dsyme Thanks for let me know. I have not notice it because the document not clear description it. https://docs.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/#loading-other-scripts I guess we can improve the document to description the rule: The default Module name will be auto match the File Name, with Upper case by default. If you do not want the default Upper case module name, You should add one line
module then following by your own module name (lower case ) or what you want |
@cnmade Thank you , yes, I'll update the docs now |
@cnmade please review dotnet/docs#25297 |
Message about identifier not defined - FS0039 - when VS edits a new solution. That is, VS has not yet been closed since the solution was created.
This issue easily and reliably reproduces every time, unlike some other issues related to FS0039. Hopefully it can get smashed in a flash, and maybe it's possible to get a grip on similar errors through this one. I've been waiting for that one for years => #3510
After reopening the solution with VS, the error message is gone, even if .vs and bin and obj is deleted before reopening.
Repro steps
This is what Bug.fs contains.
And the call in main looks like this.
The solution is attached. Please note that the solution is attached only to make it clear what it should look like, since there doesn't seem to be a way to make the error appear when opening an existing solution - so you just have to follow the steps to recreate the solution.
Bug.zip
Known workarounds
Close VS. Then reopen the solution. Error message is gone.
Other
Visual Studio 16.5.0
The text was updated successfully, but these errors were encountered: