hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.27k stars 215 forks source link

Error with Library's `using {f} for ...` #1525

Closed BenTheKush closed 1 year ago

BenTheKush commented 1 year ago

Describe the bug There is a compilation error/parse error for code that compiles for solc

To Reproduce I've added a minimized version of this bug to this repository. I'm reproducing it here for convenience.

issue1525.sol:

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

library Lib {
    using {f} for int256;

    function f(int256 a) internal pure returns (int256) {
        return a;
    }
}

Running

$ solang compile --target solana issue1525.sol
error: 'f' not found
  ┌─ /Users/benku/Playground/issue1525.sol:5:12
  │
5 │     using {f} for int256;
  │            ^

$ solc issue1525.sol
Compiler run successful, no output requested.

Ran with solang 0.3.0