mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Errors about nested mapping in event parameter are fatal.
(Also applies for error parameters.)
This commit is contained in:
parent
b00027724a
commit
cc915f023e
@ -25,6 +25,7 @@ Bugfixes:
|
||||
* Standard JSON: Properly allow the ``inliner`` setting under ``settings.optimizer.details``.
|
||||
* Type Checker: Fix internal compiler error related to having mapping types in constructor parameter for abstract contracts.
|
||||
* Type Checker: Fix internal compiler error when attempting to use an invalid external function type on pre-byzantium EVMs.
|
||||
* Type Checker: Make errors about (nested) mapping type in event or error parameter into fatal type errors.
|
||||
|
||||
|
||||
AST Changes:
|
||||
|
@ -3411,7 +3411,7 @@ void TypeChecker::checkErrorAndEventParameters(CallableDeclaration const& _calla
|
||||
for (ASTPointer<VariableDeclaration> const& var: _callable.parameters())
|
||||
{
|
||||
if (type(*var)->containsNestedMapping())
|
||||
m_errorReporter.typeError(
|
||||
m_errorReporter.fatalTypeError(
|
||||
3448_error,
|
||||
var->location(),
|
||||
"Type containing a (nested) mapping is not allowed as " + kind + " parameter type."
|
||||
|
@ -4,6 +4,3 @@ contract C {
|
||||
}
|
||||
// ----
|
||||
// TypeError 3448: (14-35): Type containing a (nested) mapping is not allowed as error parameter type.
|
||||
// TypeError 3417: (14-35): Internal or recursive type is not allowed as error parameter type.
|
||||
// TypeError 3448: (70-91): Type containing a (nested) mapping is not allowed as error parameter type.
|
||||
// TypeError 3417: (70-91): Internal or recursive type is not allowed as error parameter type.
|
||||
|
@ -3,5 +3,3 @@ contract c {
|
||||
}
|
||||
// ----
|
||||
// TypeError 3448: (41-72): Type containing a (nested) mapping is not allowed as event parameter type.
|
||||
// TypeError 3417: (41-72): Internal or recursive type is not allowed as event parameter type.
|
||||
// TypeError 8598: (17-132): More than 4 indexed arguments for anonymous event.
|
||||
|
@ -0,0 +1,3 @@
|
||||
error E (mapping (uint => uint));
|
||||
// ----
|
||||
// TypeError 3448: (9-31): Type containing a (nested) mapping is not allowed as error parameter type.
|
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
event E (mapping (uint => uint) [2]);
|
||||
}
|
||||
// ----
|
||||
// TypeError 3448: (26-52): Type containing a (nested) mapping is not allowed as event parameter type.
|
Loading…
Reference in New Issue
Block a user