| 158 | } |
| 159 | |
| 160 | Expect<ValMut> Loader::loadMutability(ASTNodeAttr From) { |
| 161 | // Read the mutability byte. |
| 162 | auto B = FMgr.readByte(); |
| 163 | if (unlikely(!B)) { |
| 164 | return logLoadError(B.error(), FMgr.getLastOffset(), From); |
| 165 | } |
| 166 | |
| 167 | // Check the mutability cases. |
| 168 | switch (static_cast<ValMut>(*B)) { |
| 169 | case ValMut::Const: |
| 170 | case ValMut::Var: |
| 171 | return static_cast<ValMut>(*B); |
| 172 | default: |
| 173 | return logLoadError(ErrCode::Value::InvalidMut, FMgr.getLastOffset(), From); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | Expect<void> Loader::loadFieldType(AST::FieldType &FType) { |
| 178 | // The error code logging is handled. |
nothing calls this directly
no test coverage detected