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
F# interactive fails to load proper project "version" when using multiple scripts load #13866
Comments
I could not repro this issue with information provided. @jkone27: Would it be possible for you to narrow it down to a minimal sequence of steps that can reproduce this bug? |
So far I got it down to a fairly small repro, four script files still needed:
~same error:
|
This unfortunately seems to currently be by design for Fixing this would significantly improve Sidenote: F# language specification describes how scripts should behave when compiled and that includes loading same script file multiple times:
and in fact, when compiled with |
I believe I've found a viable workaround: #load "Domain.fsx"
#load "Dto.fsx"
#load "Infrastructure.fsx" with one: #load "Domain.fsx" "Dto.fsx" "Infrastructure.fsx" I am not yet convinced if this is always a feasible solution to these kinds of issues, but @jkone27, let me know if it works for you |
Yes this workaround works! thanks a LOT 👍 💚 |
Please note the above is the correct approach Closing as by-design. |
Thanks, @abonie just suggesting also for new users, maybe the compiler error should make this design decision more explicit to the user, or suggest this option if there is a multiline load
--> compiler fail with
|
@jkone27 I believe there are subtleties about how those directives impact the evaluation, that would make such adjustment problematic, on top of backward compatibility. Adjusting https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/#f-interactive-directive-reference so it shows that several files can be loaded seems to be a good solution to make it explicit, what can be done with this directive. |
I get this behaviour when referencing multiple scripts from different files
i have a single Domain.fsx which i load in multiple files and then open as open Domain
I am not sure why is not possible to load Domain, ionide in vscode shows no errors.
note: restarting ionide - closing/reopening vscode doesnt help
The text was updated successfully, but these errors were encountered: