Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants