ethereum-optimism / solidity

[Optimism] (Slightly) modified Solidity compiler
GNU General Public License v3.0
38 stars 15 forks source link

Compiler does not gracefully handle errors due to missing override keyword #15

Open maurelian opened 3 years ago

maurelian commented 3 years ago

Description

Steps to Reproduce

  1. In the contracts repo, the override keyword from a function which overrides an unimplemented interface function. (ie. CTC.batches()).
  2. Run yarn build, it should fail with the following unclear error message:
Compiling 72 files with OVM compiler 0.7.6
An unexpected error occurred:

TypeError: Cannot use 'in' operator to search for '@openzeppelin/contracts/math/SafeMath.sol' in undefined
    at OverriddenTaskDefinition._action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/@eth-optimism/plugins/src/hardhat/compiler/index.ts:149:19)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:14)
    at SimpleTaskDefinition.action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/builtin-tasks/compile.ts:671:18)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Opt
Compiling 72 files with OVM compiler 0.7.6
An unexpected error occurred:

TypeError: Cannot use 'in' operator to search for '@openzeppelin/contracts/math/SafeMath.sol' in undefined
    at OverriddenTaskDefinition._action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/@eth-optimism/plugins/src/hardhat/compiler/index.ts:149:19)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:14)
    at SimpleTaskDefinition.action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/builtin-tasks/compile.ts:671:18)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:14)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:14)
    at SimpleTaskDefinition.action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/builtin-tasks/compile.ts:964:37)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:14)
    at SimpleTaskDefinition.action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/builtin-tasks/compile.ts:395:45)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:14)
    at SimpleTaskDefinition.action (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/builtin-tasks/compile.ts:1320:63)
    at Environment._runTaskDefinition (/Users/maurelian/Projects/Optimism/contracts-v2/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.