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

keyword "interface" not accepted (compile fails) #560

Closed
d10r opened this issue Sep 7, 2017 · 4 comments
Closed

keyword "interface" not accepted (compile fails) #560

d10r opened this issue Sep 7, 2017 · 4 comments

Comments

@d10r
Copy link
Contributor

d10r commented Sep 7, 2017

This has already been asked in the Gitter channel by others, but not answered (as far as I could see).


Issue

Compiling files containing interface definitions fails with

SyntaxError: Error parsing /somepath/somefile.sol: Expected "contract", "import", "library", "pragma", "using", comment, end of input, end of line, or whitespace but "i" found.

Steps to Reproduce

Create a solidity file containing an interface definition, e.g.

interface IDummy {
    function dummy();
}

and try to have it compiled with truffle compile.

Expected Behavior

Since the interface keyword is supported since Solidity 0.4.11 (seeChangelog), truffle - which is using solc 0.4.15 - should recognize it.

In Remix IDE, the behaviour is as expected. If the compiler version is at least 0.4.11, files with interface definitions compile.

Actual Results

$ truffle compile
SyntaxError: Error parsing /home/didi/src/p4p/blockchain/contracts/PlayToken.sol: Expected "contract", "import", "library", "pragma", "using", comment, end of input, end of line, or whitespace but "i" found. Line: 4, Column: 1
    at peg$buildStructuredError (/home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:181971:12)
    at Object.peg$parse [as parse] (/home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:185570:11)
    at Object.parse (/home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:83782:23)
    at /home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:59136:36
    at /home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:49114:5
    at /home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:60660:16
    at next (/home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:69109:18)
    at /home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:49099:7
    at /home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:96498:5
    at /home/didi/.nvm/versions/node/v6.11.0/lib/node_modules/truffle/build/cli.bundled.js:69014:16

Environment

  • Operating System: Ubuntu 14.04.5 LTS
  • Truffle version: Truffle v3.4.9 (core: 3.4.8), Solidity v0.4.15 (solc-js)
  • Ethereum client:
  • node version: v6.11.0 (also tested with v8.4.0)
  • npm version: 3.10.10 (also tested with 5.3.0)
@mrhn
Copy link

mrhn commented Sep 11, 2017

Having the same problem with solc 0.4.15 also... fresh install this friday.

@kevbry
Copy link

kevbry commented Sep 21, 2017

Same issue.

Environment:

  • OS: Windows 7
  • Truffle v3.4.9 (core: 3.4.8)
  • Solidity v0.4.15 (solc-js)
  • Node version 8.4.0
  • NPM version 5.3.0

@hotblade
Copy link

Same problem.

  • MacOS Sierra
  • Truffle 3.4.9
  • Solc 0.4.16+commit.d7661dd9.Darwin.appleclang

@dlocation
Copy link

dlocation commented Oct 3, 2017

We must wait for update solidity-parser package that implement interface support
PR has been merged yet but realease not published yet
ConsenSysMesh/solidity-parser#68

OR You can swap to beta version of truffle.

@gnidan gnidan closed this as completed Oct 9, 2017
cchrs referenced this issue in aletheia-foundation/aletheia-app Oct 12, 2017
There are still tests to add, which should take about a week. I'm
submitting this for comment, as there is still much work to be
done. For example, the reputation isn't apportioned out upon
Manuscript submission. I'll fix this in the coming week(s).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants