namespaced classes lose members if relation statement comes after namespace #4519
Labels
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
When a relation is declared after a namespace, the members disappear.
The following diagram will not include the
+Id: Guid
in either classwhile
will display the
+Id: Guid
because the relationships are before the namespace declaration.Steps to reproduce
See Description and code sample
Screenshots
Code Sample
Setup
develop
branch)Additional Context
This is a bug in the parser/classDb file.
Namespaces depend on successfully deleting the class from the base
classes
variable:mermaid/packages/mermaid/src/diagrams/class/classDb.ts
Line 452 in 3d11781
However, when relations are added, they call addClass() (again)
mermaid/packages/mermaid/src/diagrams/class/classDb.ts
Lines 132 to 136 in 3d11781
and so the class is re-instantiated w/o the members that were 'known" from adding to namespaces
The text was updated successfully, but these errors were encountered: