Minor improvements to TypeWithDict #6935
Merged
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.
Some ROOT6 specific improvements to TypeWithDict.
Define a new dummy type to be used as the type for an invalid TypeWithDict. "void" was being used, but this is no good since there can be a valid TypeWithDict for type "void".
The type used here is a pointer to a pointer to an empty enum{}. This is an arbitrary type that will never be used otherwise.
The typedef for the dummy type being used for the type_info field of a valid TypeWithDict with no type_info information was renamed from dummyEnum to dummyType, because in the future it will be used for types other than enums.
To check if a valid TypeWithDict has valid type_info information, simply check that the type-info field is not dummyType. Remove the current unnecessarily complex check for this.
(A fix) When constructing a TypeWithDict from a TType, explicitly check that the type is not an array or a pointer before creating a TClass for the type. I happened to notice that in some rare cases an array of classes was being treated as a class by TType. This will all be moot after TType is removed entirely, but, for now, the code should be correct.
Add some statements useful in debugging, but comment them out. This makes it easy to add them when needed.
Please merge this request as soon as convenient.