Skip to content

Commit

Permalink
UAReferenceContext - causes circular references #558
Browse files Browse the repository at this point in the history
- removed IsSubtypeOf - it is not longer used.
- UT 👍
  • Loading branch information
mpostol committed Apr 4, 2021
1 parent 29b295f commit c6ec12c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ public void ImportUANodeSetTest()
asp.UTGetReferences(NodeId.Parse(newNodeSet.Items[0].NodeId), x => references.Add(x));
Assert.AreEqual<int>(1, references.Count);
Assert.AreEqual<ReferenceKindEnum>(ReferenceKindEnum.HasProperty, references[0].ReferenceKind);
//UAReferenceContext - causes circular references #558
Assert.IsTrue(references[0].IsSubtypeOf(ReferenceTypeIds.HasProperty));
Assert.AreEqual<ReferenceKindEnum>(ReferenceKindEnum.HasProperty, references[0].ReferenceKind);
references.Clear();
asp.UTGetReferences(NodeId.Parse(newNodeSet.Items[1].NodeId), x => references.Add(x));
Assert.AreEqual<int>(2, references.Count);
Expand Down
8 changes: 0 additions & 8 deletions SemanticData/UANodeSetValidation/UAReferenceContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ internal UAReferenceContext(Reference reference, IAddressSpaceBuildContext addre

#region semantics

//TODO UAReferenceContext - causes circular references #558
internal bool IsSubtypeOf(NodeId referenceType)
{
List<IUANodeContext> inheritanceChain = new List<IUANodeContext>();
m_AddressSpace.GetBaseTypes(TypeNode, inheritanceChain);
return inheritanceChain.Where<IUANodeContext>(x => x.NodeIdContext == referenceType).Any<IUANodeContext>();
}

/// <summary>
/// Gets the kind of the reference.
/// </summary>
Expand Down

0 comments on commit c6ec12c

Please sign in to comment.