diff options
author | Christian Parpart <christian@ethereum.org> | 2018-07-12 20:57:42 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-07-16 18:15:36 +0800 |
commit | 396bf118585d213a397be990b5118a47ac4753c1 (patch) | |
tree | cc2f955335203950ba019a2fd1560a5ebf53003e /libsolidity | |
parent | 31e56f9f9976cee44f000226318dca566f0f0b79 (diff) | |
download | dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.tar dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.tar.gz dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.tar.bz2 dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.tar.lz dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.tar.xz dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.tar.zst dexon-solidity-396bf118585d213a397be990b5118a47ac4753c1.zip |
enforce interface-functions to be external-declared
- libsolidity: Enforce interface-functions must be external-declared.
- Changelog adapted to reflect changes wrt. functions in interfaces.
- test: Adjustments according to prior interface-function changes.
- tests: Adapting SolidityEndToEndTest to interface-function change.
- docs: Adapted documentation to interface-function change.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index cc373e03..72be7394 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -671,18 +671,10 @@ bool TypeChecker::visit(FunctionDefinition const& _function) { if (_function.isImplemented()) m_errorReporter.typeError(_function.location(), "Functions in interfaces cannot have an implementation."); - if (_function.sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050)) - { - if (_function.visibility() != FunctionDefinition::Visibility::External) - m_errorReporter.typeError(_function.location(), "Functions in interfaces must be declared external."); - } - else - { - if (_function.visibility() < FunctionDefinition::Visibility::Public) - m_errorReporter.typeError(_function.location(), "Functions in interfaces cannot be internal or private."); - else if (_function.visibility() != FunctionDefinition::Visibility::External) - m_errorReporter.warning(_function.location(), "Functions in interfaces should be declared external."); - } + + if (_function.visibility() != FunctionDefinition::Visibility::External) + m_errorReporter.typeError(_function.location(), "Functions in interfaces must be declared external."); + if (_function.isConstructor()) m_errorReporter.typeError(_function.location(), "Constructor cannot be defined in interfaces."); } |