Repository navigation
Conversation
We convert descendant-interface slices passed to read-only verification functions, allowing ``[]ISomeItem`` arguments for ``[]IAbstractItem``. We preserve nil and avoid copies for matching slice types. We cover non-optional and optional calls in the shared regression model and regenerate the affected parse, intermediate, and SDK goldens.
5 tasks
Contributor
|
Thanks, @chris-koo ! I looked at the code. Do I understand that correctly -- you make an in-situ copy of the list to satisfy the invariance in Go? Isn't that something that caller needs to do, not the called code? Could we maybe discuss this change in a phone call live rather than over GitHub? |
Contributor
|
Superseded by #852. |
Contributor
|
Just a note to this PR: it created a copy on every invocation, which is potentially inefficient. #852 uses generics, analogous to what we did with implementation-specific Go snippets for AAS V3.1 so that no copies need be created. |
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.
Generated Go verification fails to compile when a descendant-interface
slice is passed to a function expecting a base-interface slice, for example
[]ISomeItemto[]IAbstractItem.We convert only mismatching slices passed to read-only transpiled verification
functions. The conversion preserves nil and evaluates each argument once.
We extend the shared regression model for non-optional and optional calls
and regenerate the affected parse, intermediate, and SDK goldens.
Refs #840. Following the review of #841, this PR isolates the compilation fix.
Validation
tests, doctests, metadata checks, and the README help check.
list_of_classes.unchanged upstream generator.
go build ./....