Solidity Source Files Requires different compiler version

Viewed 12022
pragma solidity ^0.5.3;

contract Inbox {

    string public message;

    function Inbox(string initialMessage) public {
         message = initialMessage;
    }

    function setMessage(string newMessage) public {
         message = newMessage;
    }

    function getMessage() public view returns (string) {
         return getMessage;
    }

}

Error : browser/Untitled.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.5.3-nightly.2019.1.15+commit.6146c59a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version contract Inbox {

I'm using the correct version. I've tried debugging and look on forums, but I cannot find the right solution. Any other experiencing same problem?

2 Answers

The answer is directly in the error message you're receiving:

note that nightly builds are considered to be strictly less than the released version

You are specifying to use version 0.5.3 in your contract which is later than the selected compiler. To get around this, you can either drop down to 0.5.2 or you can change your pragma to

pragma solidity >0.5.2;

For more information, look at this ticket.

Related