mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10506 from ethereum/superInLibs
Make super unavailable in libraries.
This commit is contained in:
commit
254119d146
@ -17,6 +17,7 @@ Bugfixes:
|
||||
* SMTChecker: Fix internal compiler error when doing bitwise compound assignment with string literals.
|
||||
* SMTChecker: Fix internal error when trying to generate counterexamples with old z3.
|
||||
* SMTChecker: Fix segmentation fault that could occur on certain SMT-enabled sources when no SMT solver was available.
|
||||
* Type Checker: ``super`` is not available in libraries.
|
||||
* Yul Optimizer: Fix a bug in NameSimplifier where a new name created by NameSimplifier could also be created by NameDispenser.
|
||||
* Yul Optimizer: Removed NameSimplifier from optimization steps available to users.
|
||||
|
||||
|
@ -285,7 +285,8 @@ bool NameAndTypeResolver::resolveNamesAndTypesInternal(ASTNode& _node, bool _res
|
||||
solAssert(_resolveInsideCode, "");
|
||||
|
||||
m_globalContext.setCurrentContract(*contract);
|
||||
updateDeclaration(*m_globalContext.currentSuper());
|
||||
if (!contract->isLibrary())
|
||||
updateDeclaration(*m_globalContext.currentSuper());
|
||||
updateDeclaration(*m_globalContext.currentThis());
|
||||
|
||||
for (ASTPointer<InheritanceSpecifier> const& baseContract: contract->baseContracts())
|
||||
|
7
test/libsolidity/syntaxTests/super/super_in_function.sol
Normal file
7
test/libsolidity/syntaxTests/super/super_in_function.sol
Normal file
@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
}
|
||||
function f() pure {
|
||||
super;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 7576: (39-44): Undeclared identifier. "super" is not (or not yet) visible at this point.
|
7
test/libsolidity/syntaxTests/super/super_in_library.sol
Normal file
7
test/libsolidity/syntaxTests/super/super_in_library.sol
Normal file
@ -0,0 +1,7 @@
|
||||
library L {
|
||||
function f() public {
|
||||
(super);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 7576: (41-46): Undeclared identifier. "super" is not (or not yet) visible at this point.
|
Loading…
Reference in New Issue
Block a user