diff options
| author | sriramm-nv <85252063+sriramm-nv@users.noreply.github.com> | 2024-04-05 16:47:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-05 16:47:47 -0700 |
| commit | 1b3887f462d01b83690200b9cbcb0dd902b2c0e9 (patch) | |
| tree | 9b032b6713dd0bd7549635a90ef0280fd691d120 /docs/_includes | |
| parent | d61f81374272c2abc34eecab19e916b979b08a55 (diff) | |
Fix __init() functions that returns an existing value (#3866)
Fixes the issue #3671
* The __init constructors are not expected to return a value like other member
functions, but must construct a new value and return the struct type or none.
* This patch enables this behavior in the IR lowering without complaining about
illegal situations where the user returns an invalid type or none at all.
Translate ordinary struct `return ...;` to `this = ...; return this;`
Translate NonCopyableType struct `return ...;` to `return this;`
* This patch also fixes the issue with type checking when __init()
returns a void that mismatches the base type of the struct/ class
Translate ordinary struct `return;` to `return this;`
Translate NonCopyableType struct `return;` to `return;`
* Add end-to-end test and compile only tests to check the above behavior.
Diffstat (limited to 'docs/_includes')
0 files changed, 0 insertions, 0 deletions
