Avatar
On the other hand, type-checking the function bodies before macro expansion has other issues. For one, the declarations to which an attached macro is attached are generally not type-checked at all prior to expansion, so type-checking the body prior to expansion would be a departure from that. Additionally, type-checking a function body can be expensive at compile time, and doing that work twice (once for the function body as-written, once after expansion) could increase compile times unacceptably. Finally, type-checking the function body before macro expansion limits what can be expressed by function body macros.
関数本文の型チェックは何故か必要そうだね。attached macroは展開前に型チェックしてなくて展開後に型チェックしててOKだけど、func macroは展開前と後の2回型チェックしたいらしい。
3:49 AM
型チェックというかコンパイルと書いてるから、型推論とか最適化の何かが関数本文に必要という感じなのかな