Last active
September 26, 2018 14:39
-
-
Save maurelian/ce15d6fe0daca64b324ca0c1502017ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
contract ISomething { | |
function fooSomething() returns(uint); | |
} | |
contract BarGuy { | |
// This internal function use the type system for additional safety guarantees onthe input addres. | |
function barThing (ISomething _iSomething) internal returns(uint){ | |
uint x = _iSomething.fooSomething(); | |
} | |
} | |
contract BarDad is BarGuy { | |
function barbarbar(address _addr){ | |
uint a = barThing(_addr); // TypeError: Invalid type for argument in function call. Invalid implicit conversion from address to contract ISomething requested. | |
uint a = barThing(_addr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment