mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Suggest the experimental ABI encoder if using structs as function parameters
This commit is contained in:
parent
226bfe5be1
commit
e9d256ddf4
@ -4,6 +4,8 @@ Features:
|
|||||||
* Inline Assembly: Issue warning for using jump labels (already existed for jump instructions).
|
* Inline Assembly: Issue warning for using jump labels (already existed for jump instructions).
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
* Type Checker: Suggest the experimental ABI encoder if using ``struct``s as function parameters
|
||||||
|
(instead of an internal compiler error).
|
||||||
|
|
||||||
### 0.4.19 (2017-11-30)
|
### 0.4.19 (2017-11-30)
|
||||||
|
|
||||||
|
@ -570,6 +570,16 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
|
|||||||
m_errorReporter.typeError(var->location(), "Type is required to live outside storage.");
|
m_errorReporter.typeError(var->location(), "Type is required to live outside storage.");
|
||||||
if (_function.visibility() >= FunctionDefinition::Visibility::Public && !(type(*var)->interfaceType(isLibraryFunction)))
|
if (_function.visibility() >= FunctionDefinition::Visibility::Public && !(type(*var)->interfaceType(isLibraryFunction)))
|
||||||
m_errorReporter.fatalTypeError(var->location(), "Internal or recursive type is not allowed for public or external functions.");
|
m_errorReporter.fatalTypeError(var->location(), "Internal or recursive type is not allowed for public or external functions.");
|
||||||
|
if (
|
||||||
|
_function.visibility() > FunctionDefinition::Visibility::Internal &&
|
||||||
|
type(*var)->category() == Type::Category::Struct &&
|
||||||
|
!_function.sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::ABIEncoderV2)
|
||||||
|
)
|
||||||
|
m_errorReporter.typeError(
|
||||||
|
var->location(),
|
||||||
|
"Structs are only supported in the new experimental ABI encoder. "
|
||||||
|
"Use \"pragma experimental ABIEncoderV2;\" to enable the feature."
|
||||||
|
);
|
||||||
|
|
||||||
var->accept(*this);
|
var->accept(*this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user