Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Declarative Services] duplicate service reference names do not cause an error #473

Closed
jeffdiclemente opened this issue Jun 2, 2020 · 0 comments · Fixed by #474
Closed

Comments

@jeffdiclemente
Copy link
Member

If a service component has more than one service reference with the same name, no error is produced. This can lead to unexpected behavior which is hard to diagnose at run-time.

The reference name must be unique among all other references in the service component (see RFC).

This type of error should be caught as early as possible. Ideally the SCRCodeGen tool should catch this and return an error which can fail a build.

test case:

{
    "scr" : { "version" : 1,
              "components": [{
                       "implementation-class": "DSSpellCheck::SpellCheckImpl",
                       "references": [{
                         "name": "foo",
                         "interface": "Bar"
                       },
                       {
                         "name": "foo",
                         "interface": "Bar"
                       }]
                       }]
           }
  }
jeffdiclemente added a commit that referenced this issue Jun 2, 2020
Fixes #473

Signed-off-by: The MathWorks, Inc. Roy.Lurie@mathworks.com
jeffdiclemente added a commit that referenced this issue Jun 9, 2020
* Error if duplicate service component reference names are used

Fixes #473

Signed-off-by: The MathWorks, Inc. Roy.Lurie@mathworks.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant