Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(solc): can parse secondary source locations #849

Merged
merged 1 commit into from Jan 31, 2022

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jan 31, 2022

Motivation

Apparently the secondarySourceLocations only contains a message field, which is at odds with the docs https://docs.soliditylang.org/en/v0.8.11/using-the-compiler.html#compiler-api

            "secondarySourceLocations": Array([
                Object({
                    "message": String(
                        "Candidate: function require(bool)",
                    ),
                }),
                Object({
                    "message": String(
                        "Candidate: function require(bool, string memory)",
                    ),
                }),
            ]),

Solution

Change types so that error can now be parsed correctly

TypeError: No matching declaration found after argument-dependent lookup.
 --> /private/var/folders/l5/lprhf87s6xv8djgd017f0b2h0000gn/T/tmp_dapp1Wk7S5/src/Contract.sol:6:13:
  |
6 |             require(address(0), "Error");
  |             ^^^^^^^
Note: Candidate: function require(bool)
Note: Candidate: function require(bool, string memory)

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@gakonst gakonst merged commit 5fefb2b into gakonst:master Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants