| 679 | /* ── expression evaluation ──────────────────────────────────────── */ |
| 680 | |
| 681 | static const CBMType *cs_unwrap_task(CSLSPContext *ctx, const CBMType *t) { |
| 682 | (void)ctx; |
| 683 | if (!t) return cbm_type_unknown(); |
| 684 | if (t->kind == CBM_TYPE_TEMPLATE) { |
| 685 | const char *n = t->data.template_type.template_name; |
| 686 | if (n && (strcmp(n, "System.Threading.Tasks.Task") == 0 || |
| 687 | strcmp(n, "System.Threading.Tasks.ValueTask") == 0)) { |
| 688 | if (t->data.template_type.template_args && t->data.template_type.template_args[0]) { |
| 689 | return t->data.template_type.template_args[0]; |
| 690 | } |
| 691 | } |
| 692 | } |
| 693 | if (t->kind == CBM_TYPE_NAMED) { |
| 694 | const char *qn = t->data.named.qualified_name; |
| 695 | if (qn && (strcmp(qn, "System.Threading.Tasks.Task") == 0 || |
| 696 | strcmp(qn, "System.Threading.Tasks.ValueTask") == 0)) { |
| 697 | return cbm_type_unknown(); |
| 698 | } |
| 699 | } |
| 700 | return t; |
| 701 | } |
| 702 | |
| 703 | static const CBMType *cs_unwrap_nullable(const CBMType *t) { |
| 704 | if (!t) return t; |
no test coverage detected