Skip to content

Commit 3f6f24a

Browse files
committed
Fixed build breaks
* Refined derivation checks to handle interfaces as the "base" uniquely * updated message on docs build project for clarity and easier readability in build logs.
1 parent e6f2909 commit 3f6f24a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

docfx/documentation.msbuildproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
</ItemGroup>
5555

5656
<Target Name="AlwaysRun" BeforeTargets="AfterBuild">
57-
<Message Importance="High" Text="NOTE: Building this target does NOTHING, docs are built using the docfx tool. This project is simply a convenient placeholder for organizing/editing files"/>
57+
<Message Importance="High" Text="NOTE: Building $(MSBuildProjectFile) does NOTHING, docs are built using the docfx tool. This project is simply a convenient placeholder for organizing/editing files"/>
5858
</Target>
5959
</Project>

src/ReferenceEqualityVerifier/ReferenceEqualityVerifier.Test/ReferenceEqualityVerifierUnitTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bool Baz(IBaz x)
200200
return this == x; // OOPS = Reference equality!
201201
}
202202
203-
bool Baz(IBaz x)
203+
bool Baz2(Class1 x)
204204
{
205205
return x == this; // OOPS = Reference equality!
206206
}

src/ReferenceEqualityVerifier/ReferenceEqualityVerifier/ReferenceEqualityAnalyzer.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,20 @@ private static bool AreEquivalent( ITypeSymbol typeSymbol, ITypeSymbol lht, ITyp
145145

146146
private static bool IsDerivedFrom( ITypeSymbol derivedType, ITypeSymbol testBaseType )
147147
{
148-
for(ITypeSymbol? baseType = derivedType; baseType != null; baseType = baseType.BaseType)
148+
if (testBaseType.TypeKind == TypeKind.Interface)
149149
{
150-
if(SymbolEqualityComparer.Default.Equals( baseType, testBaseType ))
150+
return derivedType.AllInterfaces.Contains( testBaseType, SymbolEqualityComparer.Default );
151+
}
152+
else
153+
{
154+
for(ITypeSymbol? baseType = derivedType; baseType != null; baseType = baseType.BaseType)
151155
{
152-
return true;
156+
if(SymbolEqualityComparer.Default.Equals( baseType, testBaseType ))
157+
{
158+
return true;
159+
}
153160
}
154161
}
155-
156162
return false;
157163
}
158164

0 commit comments

Comments
 (0)