Files
PURErat-crack-scode/decompiled/Libraries/microsoft.codeanalysis.csharp/Microsoft.CodeAnalysis.CSharp.Symbols/NonMissingModuleSymbol.cs
T
2026-08-27 10:56:38 -06:00

93 lines
3.5 KiB
C#

using System.Collections.Immutable;
using System.Diagnostics;
namespace Microsoft.CodeAnalysis.CSharp.Symbols;
internal abstract class NonMissingModuleSymbol : ModuleSymbol
{
private ModuleReferences<AssemblySymbol> _moduleReferences;
internal sealed override bool IsMissing => false;
internal override bool HasUnifiedReferences => GetUnifiedAssemblies().Length > 0;
internal sealed override ImmutableArray<AssemblyIdentity> GetReferencedAssemblies()
{
return _moduleReferences.Identities;
}
internal sealed override ImmutableArray<AssemblySymbol> GetReferencedAssemblySymbols()
{
return _moduleReferences.Symbols;
}
internal ImmutableArray<UnifiedAssembly<AssemblySymbol>> GetUnifiedAssemblies()
{
return _moduleReferences.UnifiedAssemblies;
}
internal override bool GetUnificationUseSiteDiagnostic(ref DiagnosticInfo result, TypeSymbol dependentType)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
AssemblySymbol containingAssembly = ContainingAssembly;
AssemblySymbol containingAssembly2 = dependentType.ContainingAssembly;
if (containingAssembly == containingAssembly2)
{
return false;
}
ImmutableArray<UnifiedAssembly<AssemblySymbol>>.Enumerator enumerator = GetUnifiedAssemblies().GetEnumerator();
while (enumerator.MoveNext())
{
UnifiedAssembly<AssemblySymbol> current = enumerator.Current;
if ((object)current.TargetAssembly == containingAssembly2)
{
AssemblyIdentity originalReference = current.OriginalReference;
AssemblyIdentity identity = containingAssembly2.Identity;
ImmutableArray<Symbol> symbols = ImmutableArray.Create((Symbol)containingAssembly, (Symbol)containingAssembly2);
DiagnosticInfo info = (DiagnosticInfo)(object)((!(identity.Version > originalReference.Version)) ? new CSDiagnosticInfo(ErrorCode.ERR_AssemblyMatchBadVersion, new object[5]
{
containingAssembly.Name,
containingAssembly.Identity.GetDisplayName(false),
originalReference.GetDisplayName(false),
containingAssembly2.Name,
identity.GetDisplayName(false)
}, symbols, ImmutableArray<Location>.Empty) : new CSDiagnosticInfo((identity.Version.Major == originalReference.Version.Major && identity.Version.Minor == originalReference.Version.Minor) ? ErrorCode.WRN_UnifyReferenceBldRev : ErrorCode.WRN_UnifyReferenceMajMin, new object[4]
{
originalReference.GetDisplayName(false),
containingAssembly.Name,
identity.GetDisplayName(false),
containingAssembly2.Name
}, symbols, ImmutableArray<Location>.Empty));
if (MergeUseSiteDiagnostics(ref result, info))
{
return true;
}
}
}
return false;
}
internal override void SetReferences(ModuleReferences<AssemblySymbol> moduleReferences, SourceAssemblySymbol originatingSourceAssemblyDebugOnly = null)
{
_moduleReferences = moduleReferences;
}
[Conditional("DEBUG")]
internal void AssertReferencesUninitialized()
{
}
[Conditional("DEBUG")]
internal void AssertReferencesInitialized()
{
}
internal sealed override NamedTypeSymbol? LookupTopLevelMetadataType(ref MetadataTypeName emittedName)
{
return GlobalNamespace.LookupNestedNamespace(((MetadataTypeName)(ref emittedName)).NamespaceSegmentsMemory)?.LookupMetadataType(ref emittedName);
}
}