I am confused why the following code is not working. Any help would be greatly appreciated.
pragma solidity >=0.4.22 <0.6.0
contract InsuranceClaimFactory{
address public claimer;
address[] public deployedInsuranceClaim;
function createInsuranceClaim () public {
address newInsuranceClaim = new InsuranceClaim(msg.sender);
deployedInsuranceClaim.push(newInsuranceClaim);
}
function getDeployedInsuranceClaims () public view returns (address[] memory){
return deployedInsuranceClaim;
}
}
The constructor for InsuranceClaim
is
constructor (address creator) public {
claimer=creator;
}
The error is
TypeError: Type contract InsuranceClaim is not implicitly convertible to expected type address
new InsuranceClaim(msg.sender)
?0.4.24
this code runs without error.