Commit ce0a216d authored by aniket-engg's avatar aniket-engg

delete from mapping will not show warning

parent a7f577bd
......@@ -8,7 +8,7 @@ function deleteFromDynamicArray () {
}
deleteFromDynamicArray.prototype.visit = function (node) {
if (common.isDeleteFromDynamicArray(node)) this.relevantNodes.push(node)
if (common.isDeleteFromDynamicArray(node) && !common.isMappingIndexAccess(node.children[0])) this.relevantNodes.push(node)
}
deleteFromDynamicArray.prototype.report = function (compilationResults) {
......
......@@ -536,6 +536,15 @@ function isIndexAccess (node) {
}
/**
* True if node is the access of a mapping index
* @node {ASTNode} node to check for
* @return {bool}
*/
function isMappingIndexAccess (node) {
return isIndexAccess(node) && node.children && node.children[0].attributes.type.startsWith('mapping')
}
/**
* True if call to code within the current contracts context including (delegate) library call
* @node {ASTNode} some AstNode
* @return {bool}
......@@ -1103,6 +1112,7 @@ module.exports = {
isSpecialVariableAccess: isSpecialVariableAccess,
isDynamicArrayAccess: isDynamicArrayAccess,
isIndexAccess: isIndexAccess,
isMappingIndexAccess: isMappingIndexAccess,
isSubScopeWithTopLevelUnAssignedBinOp: isSubScopeWithTopLevelUnAssignedBinOp,
hasFunctionBody: hasFunctionBody,
isInteraction: isInteraction,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment