From 1dfbc6d91dce8d6bdb0c63dfa1e7c677c8650df5 Mon Sep 17 00:00:00 2001 From: Muhammad Abdul Rehman Date: Sun, 6 Feb 2022 23:57:22 -0500 Subject: [PATCH 1/2] Update SkipContract.sol Fix to avoid below warning Warning: Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. --> contracts/SkipContract.sol:26:6: | 26 | (function(uint) pure returns(uint) ) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- step04_chap2_textbook/contracts/SkipContract.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/step04_chap2_textbook/contracts/SkipContract.sol b/step04_chap2_textbook/contracts/SkipContract.sol index 26f8ec6..132cbfe 100644 --- a/step04_chap2_textbook/contracts/SkipContract.sol +++ b/step04_chap2_textbook/contracts/SkipContract.sol @@ -42,12 +42,12 @@ contract SkipContract { function getSkipFunction(uint _fnNumber) internal pure - returns (function(uint) pure returns(uint)) + returns (function(uint) pure returns(uint) func) { if (_fnNumber == 1) { - return skip1; + func = skip_1; } else if (_fnNumber == 2) { - return skip2; + func = skip_2; } } From d3bbddfa5e985a3bfe81a3b3239698266305857a Mon Sep 17 00:00:00 2001 From: Muhammad Abdul Rehman Date: Mon, 7 Feb 2022 00:01:16 -0500 Subject: [PATCH 2/2] Update SkipContract.sol --- step04_chap2_textbook/contracts/SkipContract.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/step04_chap2_textbook/contracts/SkipContract.sol b/step04_chap2_textbook/contracts/SkipContract.sol index 132cbfe..f13813b 100644 --- a/step04_chap2_textbook/contracts/SkipContract.sol +++ b/step04_chap2_textbook/contracts/SkipContract.sol @@ -45,9 +45,9 @@ contract SkipContract { returns (function(uint) pure returns(uint) func) { if (_fnNumber == 1) { - func = skip_1; + func = skip1; } else if (_fnNumber == 2) { - func = skip_2; + func = skip2; } }