add validation for sequence diagram edges to descendant
This commit is contained in:
parent
a8af739064
commit
84affc96d1
1 changed files with 8 additions and 0 deletions
|
|
@ -1102,6 +1102,14 @@ func (c *compiler) validateEdges(g *d2graph.Graph) {
|
|||
c.errorf(edge.GetAstEdge(), "edge from grid cell %#v cannot enter itself", edge.Dst.AbsID())
|
||||
continue
|
||||
}
|
||||
if edge.Src.IsSequenceDiagram() && edge.Dst.IsDescendantOf(edge.Src) {
|
||||
c.errorf(edge.GetAstEdge(), "edge from sequence diagram %#v cannot enter itself", edge.Src.AbsID())
|
||||
continue
|
||||
}
|
||||
if edge.Dst.IsSequenceDiagram() && edge.Src.IsDescendantOf(edge.Dst) {
|
||||
c.errorf(edge.GetAstEdge(), "edge from sequence diagram %#v cannot enter itself", edge.Dst.AbsID())
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue