-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Labels
A-semaArea: semantic analysisArea: semantic analysisC-enhancementCategory: an issue proposing an enhancement or a PR with oneCategory: an issue proposing an enhancement or a PR with one
Description
Describe the feature
We currently do not have most of the checks for variable declarations in https://github.com/argotorg/solidity/blob/73712a01b2de56d9ad91e3b6936f85c90cb7de36/libsolidity/analysis/TypeChecker.cpp#L475-L596
We need to implement these. The entrypoint for this is in
solar/crates/sema/src/typeck/checker.rs
Lines 582 to 596 in 38f086a
| #[must_use] | |
| fn check_var_(&mut self, id: hir::VariableId, expect: bool) -> Ty<'gcx> { | |
| let var = self.gcx.hir.variable(id); | |
| let _ = self.visit_ty(&var.ty); | |
| let ty = self.gcx.type_of_item(id.into()); | |
| if let Some(init) = var.initializer { | |
| // TODO: might have different logic vs assignment | |
| self.check_assign(ty, init); | |
| if expect { | |
| let _ = self.expect_ty(init, ty); | |
| } | |
| } | |
| // TODO: checks from https://github.com/ethereum/solidity/blob/9d7cc42bc1c12bb43e9dccf8c6c36833fdfcbbca/libsolidity/analysis/TypeChecker.cpp#L472 | |
| ty | |
| } |
Additional context
No response
Metadata
Metadata
Assignees
Labels
A-semaArea: semantic analysisArea: semantic analysisC-enhancementCategory: an issue proposing an enhancement or a PR with oneCategory: an issue proposing an enhancement or a PR with one