So I've updated solidity to version 0.5.0 and I'm trying to re-write my code. One thing that worked before was comparing contract (represented by its address) to addresses. So now I'm getting the following error:
TypeError: Operator == not compatible with types contract User and address payable
Then I've tried to just add the address field, but the compiler won't allow it. For instance, the following won't compile because it expects ; instead of . :
address a = User.address;
So how do I solve this problem of getting the address field from a contract so the compiler lets me compare those two? Here is the part of the code that won't compile because of that require statement:
mapping(address=>User) public users;
function register(string memory _nome) public {
require(users[msg.sender]==0x0000000000000000000000000000000000000000);
users[msg.sender] = new User(_nome,msg.sender);
}