dotnet / dotnet/fsharp

Non deterministic edge case with parallel reference resolution

Open
#18,977 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

I'm investigating the feasibility of enabling some of the parallelizations by default.

Now, with `parallelReferenceResolution` on, there is a test failure in https://github.com/dotnet/fsharp/blob/601a68970ab7c076ead06737657dc3a7c68313a3/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ModuleDefinitions/ModuleDefinitions.fs#L307

What the test does is simply reference two assemblies that define the same type (namespace and all).

Now, the expected result appears to be that the order of referencing makes one type shadow another. This randomly fails with parallel resolution, because of undetermined order. Also this does not seem optimal tbh, I'd expect at least a warning of some kind?

The internet says C# in the same situation will fail the compilation and require `extern alias` to disambiguate the types.

I wonder, if F# behavior in this case is specified and expected? The existence of a test suggest so.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.