Add intrinsics.procedure_of

```odin
foo :: proc(x: $T) { fmt.println(x) }
bar :: intrinsics.procedure_of(foo(int(123))) // parameters are never ran at compile time, similar to `size_of`
bar(333) // prints 333
```
This commit is contained in:
gingerBill
2024-06-10 15:02:34 +01:00
parent 1945218f6d
commit fa3cae2bb0
9 changed files with 87 additions and 6 deletions

View File

@@ -1479,6 +1479,10 @@ gb_internal Entity *entity_of_node(Ast *expr) {
case_ast_node(cc, CaseClause, expr);
return cc->implicit_entity;
case_end;
case_ast_node(ce, CallExpr, expr);
return ce->entity_procedure_of;
case_end;
}
return nullptr;
}