-
Notifications
You must be signed in to change notification settings - Fork 77
Labels
A-semaArea: semantic analysisArea: semantic analysisC-tracking-issueCategory: an issue that collects information about a broad development initiativeCategory: an issue that collects information about a broad development initiative
Description
Describe the feature
Tracking issue to capture all variants of type checking for ExprKind::Call here:
solar/crates/sema/src/typeck/checker.rs
Lines 150 to 179 in f6cf16d
| hir::ExprKind::Call(callee, ref args, ref _opts) => { | |
| let mut callee_ty = self.check_expr(callee); | |
| // Get the function type for struct constructors. | |
| if let TyKind::Type(struct_ty) = callee_ty.kind | |
| && let TyKind::Struct(id) = struct_ty.kind | |
| { | |
| callee_ty = struct_constructor(self.gcx, struct_ty, id); | |
| } | |
| // TODO: `array.push() = x;` is the only valid call lvalue | |
| let is_array_push = false; | |
| let ty = match callee_ty.kind { | |
| TyKind::FnPtr(_f) => { | |
| // dbg!(callee_ty); | |
| todo!() | |
| } | |
| TyKind::Type(to) => self.check_explicit_cast(expr.span, to, args), | |
| TyKind::Event(..) | TyKind::Error(..) => { | |
| // return callee_ty | |
| todo!() | |
| } | |
| TyKind::Err(_) => callee_ty, | |
| _ => { | |
| let msg = | |
| format!("expected function, found `{}`", callee_ty.display(self.gcx)); | |
| let mut err = self.dcx().err(msg).span(callee.span); | |
| err = err.span_note(expr.span, "call expression requires function"); | |
| self.gcx.mk_ty_err(err.emit()) | |
| } | |
| }; |
Refer to the parent tracking issue for guidance on working on the typechecker.
Additional context
No response
Sub-issues
Metadata
Metadata
Assignees
Labels
A-semaArea: semantic analysisArea: semantic analysisC-tracking-issueCategory: an issue that collects information about a broad development initiativeCategory: an issue that collects information about a broad development initiative