Test/DocTest.dll:
$(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
+Test/DocTest-InternalInterface.dll:
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
+
Test/DocTest.dll-v1:
-rm -f Test/DocTest.cs
cp Test/DocTest-v1.cs Test/DocTest.cs
update-monodocer-dropns-classic-secondary: $(PROGRAM)
$(MAKE) Test/DocTest-DropNS-classic-secondary.dll
$(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-secondary.dll
-
+
+check-monodocer-internal-interface: $(PROGRAM)
+ # Tests to make sure internal interfaces that are explicitly implemented are not documented
+ -rm -Rf Test/en.actual
+ $(MAKE) Test/DocTest-InternalInterface.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-InternalInterface.dll
+ diff --exclude=.svn -rup Test/en.expected-internal-interface Test/en.actual
check-monodocer-update: $(PROGRAM)
find Test/en.expected -name \*.xml -exec rm "{}" \;
check-monodocer-update \
check-monodocer-dropns-classic \
check-monodocer-dropns-classic-withsecondary \
+ check-monodocer-internal-interface \
check-monodocer-delete-update \
check-mdoc-export-html-update \
check-mdoc-export-msxdoc-update \
throw new ArgumentException ("Unknown kind for type: " + type.FullName);
}
- private static bool IsPublic (TypeDefinition type)
+ public static bool IsPublic (TypeDefinition type)
{
TypeDefinition decl = type;
while (decl != null) {
string sig = memberFormatters [0].GetDeclaration (m);
if (sig == null) return false;
if (seenmembers.ContainsKey(sig)) return false;
+
+ // Verify that the member isn't an explicitly implemented
+ // member of an internal interface, in which case we shouldn't return true.
+ MethodDefinition methdef = null;
+ if (m is MethodDefinition)
+ methdef = m as MethodDefinition;
+ else if (m is PropertyDefinition) {
+ var prop = m as PropertyDefinition;
+ methdef = prop.GetMethod ?? prop.SetMethod;
+ }
+
+ if (methdef != null) {
+ TypeReference iface;
+ MethodReference imethod;
+
+ if (methdef.Overrides.Count == 1) {
+ DocUtils.GetInfoForExplicitlyImplementedMethod (methdef, out iface, out imethod);
+ if (!IsPublic (iface.Resolve ())) return false;
+ }
+ }
+
return true;
})
.ToArray();
if (!inheritedInterfaces.Contains (GetQualifiedTypeName (lookup)))
userInterfaces.Add (iface);
}
- return userInterfaces;
+ return userInterfaces.Where (i => MDocUpdater.IsPublic (i.Resolve ()));
}
private static string GetQualifiedTypeName (TypeReference type)
buf.Append (full.GetName (type.BaseType).Substring ("class ".Length));
}
bool first = true;
- foreach (var name in type.Interfaces
+ foreach (var name in type.Interfaces.Where (i => MDocUpdater.IsPublic (i.Resolve ()))
.Select (i => full.GetName (i))
.OrderBy (n => n)) {
if (first) {
--- /dev/null
+namespace MyNamespace {
+ internal interface MyInternalInterface {
+ bool Foo {get;set;}
+ string FooSet {set;}
+ void FooMeth ();
+ void BarMeth ();
+ }
+
+ public class MyClass : MyInternalInterface {
+ public string Bar {get;set;}
+ public void BarMeth () {} // part of the interface, but publicly implemented
+
+ string MyInternalInterface.FooSet {set {}}
+ bool MyInternalInterface.Foo {get;set;}
+ void MyInternalInterface.FooMeth () {}
+ }
+}
--- /dev/null
+<Type Name="MyClass" FullName="MyNamespace.MyClass">
+ <TypeSignature Language="C#" Value="public class MyClass" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MyClass extends System.Object" />
+ <AssemblyInfo>
+ <AssemblyName>DocTest-InternalInterface</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public MyClass ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Bar">
+ <MemberSignature Language="C#" Value="public string Bar { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance string Bar" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.String</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="BarMeth">
+ <MemberSignature Language="C#" Value="public void BarMeth ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void BarMeth() cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
--- /dev/null
+<Overview>
+ <Assemblies>
+ <Assembly Name="DocTest-InternalInterface" Version="0.0.0.0">
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
+ </Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+ </Attribute>
+ </Attributes>
+ </Assembly>
+ </Assemblies>
+ <Remarks>To be added.</Remarks>
+ <Copyright>To be added.</Copyright>
+ <Types>
+ <Namespace Name="MyNamespace">
+ <Type Name="MyClass" Kind="Class" />
+ </Namespace>
+ </Types>
+ <Title>DocTest-InternalInterface</Title>
+</Overview>
--- /dev/null
+<Namespace Name="MyNamespace">
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+</Namespace>