SimpleClassDiagrams diamond inheritance
- Dominant language
- JavaScript
- Stars
- 25
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
While multiple inheritance is supported in the SimpleClassDiagrams formalism, creating an instance that has diamond inheritance gives an error "500:constraint (post-create noInheritanceLoops) failed".

Is this intended behavior?
- If so, we must make it explicit that diamond inheritance is not allowed.
- Otherwise, the constraint checking function should be fixed to allow this.
The constraint checking function is currently as follows:
```
var mm = '/Formalisms/__LanguageSyntax__/SimpleClassDiagram/SimpleClassDiagram/',
nout = getNeighbors('>',mm+'Class'),
visited = [];
function dfs(to_visit)
{
var curr = to_visit.pop();
if( curr == undefined )
return true;
else if( visited.indexOf(curr) > -1 )
return false;
else
{
visited.push(curr);
var ntype = (getAttr('$type',curr) == mm+'Class' ?
mm+'Inheritance' : mm+'Class');
return dfs( to_visit.concat(getNeighbors('>',ntype,curr)) );
}
}
dfs(nout);
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the SimpleClassDiagram constraint-checking function shown in the issue and reproduce the diamond-inheritance instance that triggers the post-create noInheritanceLoops error. Determine whether the formalism permits diamond inheritance; done means either the restriction is made explicit or validation accepts the instance without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100