Skip to content
Draft
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 @@ -162,7 +162,10 @@ protected override EntityHandle WriteInternal(ModuleWritingContext writeContext)
{
InterfaceImplementation intfImpl = reader.GetInterfaceImplementation(intfImplHandle);
EcmaType interfaceType = _module.TryGetType(intfImpl.Interface)?.GetTypeDefinition() as EcmaType;
if (interfaceType != null && writeContext.Factory.InterfaceUse(interfaceType).Marked)
if (interfaceType != null &&
(writeContext.Factory.InterfaceUse(interfaceType).Marked ||
(writeContext.Factory.ConstructedType((EcmaType)_module.GetObject(Handle)).Marked &&
writeContext.Factory.TypeDefinition(interfaceType.Module, interfaceType.Handle).Marked)))
Comment on lines +165 to +168
{
builder.AddInterfaceImplementation(outputHandle,
writeContext.TokenMap.MapToken(intfImpl.Interface));
Expand Down
13 changes: 0 additions & 13 deletions src/coreclr/tools/ILTrim.Tests/ILTrimExpectedFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ Attributes.StructLayout.ExplicitClass
Attributes.StructLayout.SequentialClass
Attributes.TypeWithDynamicInterfaceCastableImplementationAttributeIsKept
Basic.InstantiatedTypeWithOverridesFromObject
Basic.UninvokedInterfaceMemberGetsRemoved
Basic.UsedGenericInterfaceIsKept
Basic.UsedInterfaceIsKept
BCLFeatures.ETW.CustomEventSource
BCLFeatures.ETW.CustomLibraryEventSource
CommandLine.AddCustomStep
Expand Down Expand Up @@ -186,15 +184,11 @@ Inheritance.Interfaces.OnReferenceType.BaseProvidesInterfaceMember.GenericInterf
Inheritance.Interfaces.OnReferenceType.BaseProvidesInterfaceMember.GenericInterfaceWithMethodOnNoInstanceCtor2
Inheritance.Interfaces.OnReferenceType.BaseProvidesInterfaceMember.SimpleMethodOnNoInstanceCtor
Inheritance.Interfaces.OnReferenceType.BaseProvidesInterfaceMember.SimpleMethodOnNoInstanceCtor2
Inheritance.Interfaces.OnReferenceType.ClassImplementingInterfaceMethodsNested2
Inheritance.Interfaces.OnReferenceType.ClassUsedFromConcreteTypeHasInterfaceMethodRemoved2
Inheritance.Interfaces.OnReferenceType.InterfaceMarkOrderingDoesNotMatter
Inheritance.Interfaces.OnReferenceType.InterfaceMarkOrderingDoesNotMatter2
Inheritance.Interfaces.OnReferenceType.InterfaceMarkOrderingDoesNotMatter3
Inheritance.Interfaces.OnReferenceType.InterfaceNeededOnUnrelatedInterfaceList
Inheritance.Interfaces.OnReferenceType.InterfaceTypeInOtherUsedOnlyByCopiedAssembly
Inheritance.Interfaces.OnReferenceType.InterfaceTypeInOtherUsedOnlyByCopiedAssemblyExplicit
Inheritance.Interfaces.OnReferenceType.InterfaceUsedOnlyAsConstraintIsKept
Inheritance.Interfaces.OnReferenceType.NoInstanceCtor.NoInstanceCtorAndAssemblyPreserveAll
Inheritance.Interfaces.OnReferenceType.NoInstanceCtor.NoInstanceCtorAndTypePreserveAll
Inheritance.Interfaces.OnReferenceType.NoInstanceCtor.NoInstanceCtorAndTypePreserveMethodsWithInterfacesMarked
Expand All @@ -208,7 +202,6 @@ Inheritance.Interfaces.OnReferenceType.NoKeptCtor.LocalDowncastDoesNotCuaseOther
Inheritance.Interfaces.OnReferenceType.NoKeptCtor.PreserveDependencyPreservesInterfaceMethod
Inheritance.Interfaces.OnReferenceType.NoKeptCtor.UnusedTypeHasExplicitInterfaceMethodPreservedViaXml
Inheritance.Interfaces.OnReferenceType.NoKeptCtor.UnusedTypeHasExplicitInterfacePropertyPreservedViaXml
Inheritance.Interfaces.OnReferenceType.NoKeptCtor.UnusedTypeWithPreserveMethodsAndInterfaceTypeMarked
Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.ArrayWithIndexAssignedToReturnValue
Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.FieldDowncastedToInterface
Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.GenericType
Expand All @@ -232,13 +225,8 @@ Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.ParameterAnd
Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.ParameterOutAndLocal
Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.ParameterRefAndLocal
Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded.ReturnValueDowncastedToInterface
Inheritance.Interfaces.OnReferenceType.ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept
Inheritance.Interfaces.OnReferenceType.UnusedComInterfaceIsKept
Inheritance.Interfaces.OnReferenceType.UnusedExplicitInterfaceHasMethodPreservedViaXml
Inheritance.Interfaces.OnValueType.NoKeptCtor.InterfaceTypeRemovedWhenOnlyUsedByClassWithOnlyStaticMethod
Inheritance.Interfaces.OnValueType.NoKeptCtor.InterfaceTypeRemovedWhenOnlyUsedByClassWithOnlyStaticMethodMultiple
Inheritance.Interfaces.OnValueType.StructImplementingInterfaceMethodsNested2
Inheritance.Interfaces.OnValueType.StructUsedFromConcreteTypeHasInterfaceMethodRemoved2
Inheritance.Interfaces.OnValueType.StructWithNestedStructImplementingInterface
Inheritance.Interfaces.OnValueType.UnusedExplicitInterfaceHasMethodPreservedViaXml
Inheritance.Interfaces.RecursiveInterfaces.GenericInterfaceImplementedRecursively
Expand Down Expand Up @@ -304,7 +292,6 @@ LinkXml.EmbeddedLinkXmlPreservesAdditionalAssemblyWithOverriddenMethod
LinkXml.LinkXmlErrorCases
LinkXml.TypeWithPreserveFieldsHasBackingFieldsOfPropertiesRemoved
LinkXml.UnusedFieldPreservedByLinkXmlIsKept
LinkXml.UnusedInterfaceTypeOnTypeWithPreserveAllIsKept
LinkXml.UnusedNonRequiredTypeIsRemoved
LinkXml.UsedNonRequiredExportedTypeIsKept
LinkXml.UsedNonRequiredExportedTypeIsKeptWhenRooted
Expand Down
Loading