Skip to content

Commit

Permalink
BUGFIX: Always find latest corlib in the list of assembly references.
Browse files Browse the repository at this point in the history
  • Loading branch information
Washi1337 committed Dec 27, 2022
1 parent d80bae7 commit a0bb1df
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,11 @@ private CorLibTypeFactory CreateCorLibTypeFactory()
// TODO: perhaps check public key tokens.

IResolutionScope? mostRecentCorLib = null;
var mostRecentVersion = new Version();
foreach (var reference in AssemblyReferences)
{
if (reference.Name is not null && KnownCorLibs.KnownCorLibNames.Contains(reference.Name))
{
if (mostRecentVersion < reference.Version)
if (mostRecentCorLib is null || reference.Version > mostRecentCorLib.GetAssembly()!.Version)
mostRecentCorLib = reference;
}
}
Expand Down

0 comments on commit a0bb1df

Please sign in to comment.