In test1 (), you do not return Void, your return is the test () function, which returns void itself;
void function test(){ print("Hello"); } void function test1(){ //print Hello return test(); } /* you can not return a type func test2(){// throw error return Void; } */ void function test2(){ //code or not return test(); //calling test function returns void. }
Hope this helps!
source share