diff options
-rw-r--r-- | Notes/BoxOperator.md | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Notes/BoxOperator.md b/Notes/BoxOperator.md index 33e30268..5c1cac3e 100644 --- a/Notes/BoxOperator.md +++ b/Notes/BoxOperator.md @@ -17,6 +17,7 @@ HIR ```c++ struct ExprNode_Emplace { + /// This influences the ops trait used enum class Type { Placer, Boxer, @@ -28,9 +29,23 @@ struct ExprNode_Emplace } ``` - Type Inferrence =============== The `_Emplace` node type has a revisit to obtain the expected result type. +1. If the place has an unknown type, the pre-coercion output type is located by taking the result type and replacing all params with fresh ivars +1. A bound is added that this new type must implement `ops::Placer<T>` (or `ops::Boxer<T>`) where `T` is the result type of `m_value` +1. Add a coercion at this node? (Or leave it up to the parent node to have inserted one) + + +Expansion / Lowering +==================== + +IDEAS: +- Convert as any other operator is - in the post-typeck expansion pass + - However, since this doesn't expand to a single function call (the current RFC is four calls) that would be interesting + - Also, the current RFC introduces bindings, which can't (easily) be done in that pass +- Keep until MIR, and lower into call sequence + - Can use temporaries + - Downside: Avoids the extra validation other operators get. |