no near
This commit is contained in:
parent
6374223365
commit
1fcb075e04
2 changed files with 15 additions and 0 deletions
|
|
@ -678,6 +678,10 @@ func (c *compiler) validateNear(g *d2graph.Graph) {
|
|||
c.errorf(obj.Attributes.NearKey, "near keys cannot be set to an descendant")
|
||||
continue
|
||||
}
|
||||
if nearObj.OuterSequenceDiagram() != nil {
|
||||
c.errorf(obj.Attributes.NearKey, "near keys cannot be set to an object within sequence diagrams")
|
||||
continue
|
||||
}
|
||||
} else if isConst {
|
||||
is := false
|
||||
for _, e := range g.Edges {
|
||||
|
|
|
|||
|
|
@ -1774,6 +1774,17 @@ dst.id <-> src.dst_id
|
|||
assert.String(t, "sequence_diagram", g.Objects[0].Attributes.Shape.Value)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "near_sequence",
|
||||
|
||||
text: `x: {
|
||||
shape: sequence_diagram
|
||||
a
|
||||
}
|
||||
b.near: x.a
|
||||
`,
|
||||
expErr: `d2/testdata/d2compiler/TestCompile/near_sequence.d2:5:9: near keys cannot be set to an object within sequence diagrams`,
|
||||
},
|
||||
{
|
||||
name: "sequence-timestamp",
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue