hyperledger / solang

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

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

Closed BenTheKush closed 11 months ago

BenTheKush commented 11 months 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