Print warning for unnamed return parameters and no return statement

This commit is contained in:
Mathias Baumann
2020-10-13 13:11:29 +02:00
parent abfa136afb
commit 32b4f18023
54 changed files with 139 additions and 31 deletions
@@ -4,3 +4,5 @@ contract C {
a;
}
}
// ----
// Warning 6321: (46-50): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
@@ -9,3 +9,7 @@ contract C {
function g() internal pure returns (uint, uint, uint, D.S[20] storage x, uint) { x = x; }
}
// ----
// Warning 6321: (176-180): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (182-186): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (188-192): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (213-217): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
@@ -10,3 +10,8 @@ contract C {
function h() internal pure returns (bytes memory, string storage s) { s = s; }
}
// ----
// Warning 6321: (51-55): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (57-61): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (63-67): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (69-73): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (250-262): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.