| 4258 | } |
| 4259 | |
| 4260 | void TypeChecker::checkErrorAndEventParameters(CallableDeclaration const& _callable) |
| 4261 | { |
| 4262 | std::string kind = dynamic_cast<EventDefinition const*>(&_callable) ? "event" : "error"; |
| 4263 | for (ASTPointer<VariableDeclaration> const& var: _callable.parameters()) |
| 4264 | { |
| 4265 | if (type(*var)->containsNestedMapping()) |
| 4266 | m_errorReporter.fatalTypeError( |
| 4267 | 3448_error, |
| 4268 | var->location(), |
| 4269 | "Type containing a (nested) mapping is not allowed as " + kind + " parameter type." |
| 4270 | ); |
| 4271 | if (!type(*var)->interfaceType(false)) |
| 4272 | m_errorReporter.typeError(3417_error, var->location(), "Internal or recursive type is not allowed as " + kind + " parameter type."); |
| 4273 | if ( |
| 4274 | !useABICoderV2() && |
| 4275 | !typeSupportedByOldABIEncoder(*type(*var), false /* isLibrary */) |
| 4276 | ) |
| 4277 | m_errorReporter.typeError( |
| 4278 | 3061_error, |
| 4279 | var->location(), |
| 4280 | "This type is only supported in ABI coder v2. " |
| 4281 | "Use \"pragma abicoder v2;\" to enable the feature." |
| 4282 | ); |
| 4283 | } |
| 4284 | } |
| 4285 | |
| 4286 | Declaration const& TypeChecker::dereference(Identifier const& _identifier) const |
| 4287 | { |
nothing calls this directly
no test coverage detected