-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support builtin conversions of adaptor classes
When doing a builtin conversion of an adaptor class: - if there's no conversion happening on the adaptor class itself, - if the conversion is from and to the same adaptor class type, Then we attempt the builtin conversion step on the foundation type as well. To do this, we must convert the value from its adaptor to its foundation type. Then perform the conversion. And convert the converted (foundation) value back to the adaptor class type. This might sound funny since they are the same type, so there can be no conversion happening. But in particular, this recursion allows copy construction of the elements of a tuple or struct with more than one element that is the foundation type of a class. A struct or tuple with more than one element is no longer passed by copy; its ValueRepr becomes a pointer. So it requires a builtin conversion to perform the copy on its interior elements. This already happens for these types in PerformBuiltinConversion, but now will also be done for adaptors of these types.
- Loading branch information
Showing
4 changed files
with
234 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.