[TG-1157] Add specialised java generic class type.#1576
Closed
NlightNFotis wants to merge 7 commits intodiffblue:developfrom
Closed
[TG-1157] Add specialised java generic class type.#1576NlightNFotis wants to merge 7 commits intodiffblue:developfrom
NlightNFotis wants to merge 7 commits intodiffblue:developfrom
Conversation
Previously we only converted types that were precisely a generic parameter. Now we deal with the case where the array is T type'd.
Previously we didn't handle generic fields when we were doing specialisation, meaning they were missed. This resolves this and adds a unit test to demonstrate it.
mgudemann
suggested changes
Nov 13, 2017
| // new_tag, | ||
| // symbol_table, | ||
| // message_handler, | ||
| // replacement_components); |
Contributor
There was a problem hiding this comment.
should have commented-out code here
| { | ||
| java_specialised_generic_class_typet specialised_class; | ||
| specialised_class.set_tag(replacement_type.get_tag()); | ||
| // NOTE: the tag absolutely has to be BasicGeneric |
Contributor
There was a problem hiding this comment.
what does BasicGeneric here mean?
| { | ||
| return generic_reference.generic_type_variables()[*results]; | ||
| } | ||
| else |
Contributor
There was a problem hiding this comment.
with the above invariant, is this case possible at all ?
| new_type.generic_type_variables()=replaced_type_variables; | ||
| return new_type; | ||
| } | ||
| else if(parameter_type.subtype().id() == ID_symbol) |
Contributor
There was a problem hiding this comment.
what are the cases that can happen here? The only one seems to be arrays, please add a short documentation here.
|
|
||
| class java_specialised_generic_class_typet : public java_class_typet | ||
| { | ||
| // note the constryctor could take the components and construct it itself |
| // note the constryctor could take the components and construct it itself | ||
| // note vector of generic parameter of symbol type | ||
| public: | ||
| // TODO: to be defined more appropriately. |
| // We want to test that the specialized/instantiated class has it's field | ||
| // type updated, so find the specialized class, not the generic class. | ||
| const irep_idt test_class= | ||
| const irep_idt test_class = |
Contributor
There was a problem hiding this comment.
does this work with the changed implementation for arrays as generic parameters? These should now be of the form java::array[reference]of_java::inner_type
Contributor
Author
|
This is being superseded by #1606. Thanks for your comments everyone. |
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.
No description provided.