MCPcopy Create free account
hub / github.com/argotorg/solidity / checkErrorAndEventParameters

Method checkErrorAndEventParameters

libsolidity/analysis/TypeChecker.cpp:4260–4284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4258}
4259
4260void 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
4286Declaration const& TypeChecker::dereference(Identifier const& _identifier) const
4287{

Callers

nothing calls this directly

Calls 7

typeFunction · 0.85
parametersMethod · 0.80
fatalTypeErrorMethod · 0.80
typeErrorMethod · 0.80
containsNestedMappingMethod · 0.45
locationMethod · 0.45
interfaceTypeMethod · 0.45

Tested by

no test coverage detected