question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`compiler-version` does not work with default value

See original GitHub issue

Reproduction:

pragma solidity ^0.4.0;

contract Foo {}
{
  "rules": { "compiler-version": "error" }
}

Expected

Use default value for the compiler version (^0.5.8)

Result

  1:1  error  Compiler version ^0.4.0 does not satisfy the r semver requirement  compiler-version

Adding square bracket to the rule ("compiler-version": ["error"]) works as expected.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

13reactions
jdmedeiroscommented, May 5, 2022

This is a bug; I wish I knew enough to fix it. This: pragma solidity ^0.8.7; yields simple_storage.sol:2:1: Error: Compiler version ^0.8.7 does not satisfy the r semver requirement but this: pragma solidity ^0.8.7.0; will not throw an error.

10reactions
joaoh9commented, Mar 31, 2021

just add the compiler version to .solhint.json

  "rules": {
    "compiler-version": ["error", "^0.7.3"]
  }

also, are you sure you want to run 0.4.0 solidity version in 2020/2021?

Read more comments on GitHub >

github_iconTop Results From Across the Web

`compiler-version` does not work with default value
compiler-version ` does not work with default value.
Read more >
How do I fix the "compilerVersion" IIS error? - Stack Overflow
I had a similar problem and had to tell ASP.NET in configuration to use the 3.5 compiler as follows by modifying Web.config ....
Read more >
Maven Compiler plugin - Apache Maven
See this guide for more information. Default value is: javac . compilerVersion, String, 2.0, Version of the compiler to use, ex.
Read more >
Setup Default Arm Compiler Version - µVision User's Guide
By disabling cookies, some features of the site will not work. Accept and hide this message. Developing on Arm.
Read more >
Configuration — waffle documentation - Read the Docs
Setting Solidity compiler version¶. See compilerVersion. Usage with Truffle¶. Waffle output should be compatible with Truffle by default.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found