Check complex type values when validating assignments#1108
Merged
mint-thompson merged 2 commits intomasterfrom Jun 28, 2022
Merged
Check complex type values when validating assignments#1108mint-thompson merged 2 commits intomasterfrom
mint-thompson merged 2 commits intomasterfrom
Conversation
When validating the a complex type value used in an AssignmentRule, the value may be an InstanceDefinition. Do not assign the value if it would conflict with existing values within the complex type. Assignment of complex values is all-or-nothing: if a conflict exists on part of the complex value, no parts of the complex value are assigned. An error is reported on the line where the Instance is assigned, and the error message refers to the specific value within the Instance that has a conflict.
julianxcarter
approved these changes
Jun 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes task CIMPL-969.
When validating the a complex type value used in an AssignmentRule, the value may be an InstanceDefinition. Do not assign the value if it would conflict with existing values within the complex type. Assignment of complex values is all-or-nothing: if a conflict exists on part of the complex value, no parts of the complex value are assigned. An error is reported on the line where the Instance is assigned, and the error message refers to the specific value within the Instance that has a conflict.
The test for the "not the first type" is there as a guard against some prior logic involving
type[0].codethat caused problems for me during development. That logic has been removed, but I kept the test in just in case something similar comes up later.There is some duplicated code for restoring values in
checkAssignInlineInstance, but I felt that this implementation made more sense than adding new parameters for the existing key and value.