Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ public sealed override IEnumerable<CombinedDependencyListEntry> GetConditionalSt
if (maximallyConstructableType != this)
{
// EEType upgrading from necessary to constructed if some template instantation exists that matches up
// This ensures we don't end up having two EETypes in the system (one is this necessary type, and another one
// that was dynamically created at runtime).
if (CanonFormTypeMayExist)
{
result.Add(new CombinedDependencyListEntry(maximallyConstructableType, factory.MaximallyConstructableType(_type.ConvertToCanonForm(CanonicalFormKind.Specific)), "Trigger full type generation if canonical form exists"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
Section nativeSection = nativeWriter.NewSection();
nativeSection.Place(hashtable);

foreach (var type in factory.MetadataManager.GetTypesWithEETypes())
// We go over constructed EETypes only. The places that need to consult this hashtable at runtime
// all need constructed EETypes. Placing unconstructed EETypes into this hashtable could make us
// accidentally satisfy e.g. MakeGenericType for something that was only used in a cast. Those
// should throw MissingRuntimeArtifact instead.
//
// We already make sure "necessary" EETypes that could potentially be loaded at runtime through
// the dynamic type loader get upgraded to constructed EETypes at AOT compile time.
foreach (var type in factory.MetadataManager.GetTypesWithConstructedEETypes())
{
// If this is an instantiated non-canonical generic type, add it to the generic instantiations hashtable
if (!type.HasInstantiation || type.IsGenericDefinition || type.IsCanonicalSubtype(CanonicalFormKind.Any))
Expand Down