Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on message formatting failure instead of crash, and fix Native AOT MakeGenericType failure #110330

Merged
merged 9 commits into from
Jan 2, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,9 @@ private sealed class MakeGenericMethodSite : INodeWithRuntimeDeterminedDependenc
public IEnumerable<DependencyNodeCore<NodeFactory>.DependencyListEntry> InstantiateDependencies(NodeFactory factory, Instantiation typeInstantiation, Instantiation methodInstantiation)
{
var list = new DependencyList();
RootingHelpers.TryGetDependenciesForReflectedMethod(ref list, factory, _method.InstantiateSignature(typeInstantiation, methodInstantiation), "MakeGenericMethod");
MethodDesc instantiatedMethod = _method.InstantiateSignature(typeInstantiation, methodInstantiation);
if (instantiatedMethod.CheckConstraints(new InstantiationContext(typeInstantiation, methodInstantiation)))
RootingHelpers.TryGetDependenciesForReflectedMethod(ref list, factory, instantiatedMethod, "MakeGenericMethod");
return list;
}
}
Expand All @@ -725,7 +727,9 @@ private sealed class MakeGenericTypeSite : INodeWithRuntimeDeterminedDependencie
public IEnumerable<DependencyNodeCore<NodeFactory>.DependencyListEntry> InstantiateDependencies(NodeFactory factory, Instantiation typeInstantiation, Instantiation methodInstantiation)
{
var list = new DependencyList();
RootingHelpers.TryGetDependenciesForReflectedType(ref list, factory, _type.InstantiateSignature(typeInstantiation, methodInstantiation), "MakeGenericType");
TypeDesc instantiatedType = _type.InstantiateSignature(typeInstantiation, methodInstantiation);
if (instantiatedType.CheckConstraints(new InstantiationContext(typeInstantiation, methodInstantiation)))
RootingHelpers.TryGetDependenciesForReflectedType(ref list, factory, instantiatedType, "MakeGenericType");
return list;
}
}
Expand Down
Loading