Skip to content

Exception in DescriptorBuilder when inherited properties have the same name #36

@fra-pa

Description

@fra-pa

Hi,

the DescriptorBuilder throws an exception if a property with the same name is defined in the inheritance chain of more than one of its super classes:

Error: property <any> already defined; override of <mh:AnotherRoot#mh:any> by <props:Root#props:any> not allowed without redefines
      at DescriptorBuilder._fd7‍.r.DescriptorBuilder.assertNotDefined (lib/descriptor-builder.js:180:11)
      at DescriptorBuilder._fd7‍.r.DescriptorBuilder.addNamedProperty (lib/descriptor-builder.js:138:10)
      at DescriptorBuilder._fd7‍.r.DescriptorBuilder.addProperty (lib/descriptor-builder.js:53:8)
      at DescriptorBuilder.<anonymous> (lib/descriptor-builder.js:227:12)
      at forEach (node_modules/min-dash/dist/index.js:170:20)
      at DescriptorBuilder._fd7‍.r.DescriptorBuilder.addTrait (lib/descriptor-builder.js:202:3)
      at lib/registry.js:185:13
      at Registry._0ac‍.r.Registry.mapTypes (lib/registry.js:165:3)
      at traverseSuper (lib/registry.js:155:10)
      at forEach (node_modules/min-dash/dist/index.js:170:20)
      at Registry._0ac‍.r.Registry.mapTypes (lib/registry.js:162:3)
      at Registry._0ac‍.r.Registry.getEffectiveDescriptor (lib/registry.js:184:8)
      at Moddle._1b8‍.r.Moddle.getType (lib/moddle.js:97:32)
      at Moddle._1b8‍.r.Moddle.create (lib/moddle.js:65:19)
      at Context.<anonymous> (test/spec/properties.js:589:34)
      at processImmediate (internal/timers.js:461:21)

I created a test case with a simplified hierarchy:
multiple-inherited-properties

mh:MultipleInherited has two properties named any:

  • mh:AnotherRoot#any
  • props:Root#any

and the DescriptorBuilder does not map them into seperate namespaces.

In my use-case, the problem occurs with the UMLDI meta-model, where all the diagram types inherit from UMLDI:UMLDiagram:
umldi-inheritance

Regards,
Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogQueued in backlogbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions