Fix #9217 -- Nuget #r references do not resolve assemblies referenced through the primary one #9349
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #9217
FSI, currently requires dependent assemblies to be referenced prior to assemblies that are dependent on them. This restriction is not observed in F# projects. This needs to be addressed for nuget package management in FSI because the package manager does not know about assembly load ordering and so can't order assembly loads accordingly.
What is happening, is that when we import types from assemblies, if we haven't yet read the assemblies in which referenced types live, we generate a thing called a ccuThunk, which allows us to fix up the reference later. In the compiler all of the referenced assemblies (except provided types) are read at startup and so fixups naturally happen, however, fsharp interactive is "iterative" and so, we don't get to do the fixing up, and so, FSI has always had this issue where assemblies need to be referenced in dependency order.
This fix, effectively stores the ccuthunks, until an assembly load can provide a backing assembly to reference. So effectively it removes the load ordering on which FSI was originally dependent.
Todo: