mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix internal error for invalid data location in constructor.
This commit is contained in:
parent
56e4e9f0af
commit
f24097c38d
@ -324,7 +324,9 @@ void DeclarationTypeChecker::endVisit(VariableDeclaration const& _variable)
|
|||||||
", ",
|
", ",
|
||||||
" or "
|
" or "
|
||||||
);
|
);
|
||||||
if (_variable.isCallableOrCatchParameter())
|
if (_variable.isConstructorParameter())
|
||||||
|
errorString += " for constructor parameter";
|
||||||
|
else if (_variable.isCallableOrCatchParameter())
|
||||||
errorString +=
|
errorString +=
|
||||||
" for " +
|
" for " +
|
||||||
string(_variable.isReturnParameter() ? "return " : "") +
|
string(_variable.isReturnParameter() ? "return " : "") +
|
||||||
|
@ -2,4 +2,4 @@ contract C {
|
|||||||
constructor(uint[] calldata) public {}
|
constructor(uint[] calldata) public {}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError 6651: (29-44): Data location must be "storage" or "memory" for parameter in function, but "calldata" was given.
|
// TypeError 6651: (29-44): Data location must be "storage" or "memory" for constructor parameter, but "calldata" was given.
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
contract C {
|
||||||
|
struct S {uint x;}
|
||||||
|
constructor(S) {}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 6651: (48-49): Data location must be "storage" or "memory" for constructor parameter, but none was given.
|
Loading…
Reference in New Issue
Block a user