Report warning if contract uses abicoder v1, but IR is requested

This commit is contained in:
Alex Beregszaszi
2020-12-09 01:20:58 +00:00
parent 0d7f9ae183
commit 47b10fd751
46 changed files with 390 additions and 250 deletions
+1
View File
@@ -94,6 +94,7 @@ struct SourceUnitAnnotation: ASTAnnotation
SetOnce<std::map<ASTString, std::vector<Declaration const*>>> exportedSymbols;
/// Experimental features.
std::set<ExperimentalFeature> experimentalFeatures;
/// Using the new ABI coder. Set to `false` if using ABI coder v1.
SetOnce<bool> useABICoderV2;
};
+8
View File
@@ -1249,6 +1249,14 @@ void CompilerStack::generateIR(ContractDefinition const& _contract)
if (!compiledContract.yulIR.empty())
return;
if (!*_contract.sourceUnit().annotation().useABICoderV2)
m_errorReporter.warning(
2066_error,
_contract.location(),
"Contract requests the ABI coder v1, which is incompatible with the IR. "
"Using ABI coder v2 instead."
);
string dependenciesSource;
for (auto const* dependency: _contract.annotation().contractDependencies)
generateIR(*dependency);