Skip to content

IR codegen does not implement access to library address by contract name #15669

Open
@cameel

Description

@cameel

Discovered in #15661 (comment)

Description

A reference to a library name in inline assembly triggers an unimplemented feature error. At this point the IR codegen is considered feature-complete so this not being implemented yet is a bug.

Moreover the error does not provide any message for the user.

While we do have this case covered by a syntax test (assignment_from_library.sol), it went undiscovered until now because we don't run syntax tests via IR. When the bug is fixed, please remember to enable this test on EOF.

Environment

  • Compiler version: 0.8.28 (develop)

Steps to Reproduce

test.sol:

library L {}

contract C {
    function f() public pure {
        assembly {
            let x := L
        }
    }
}
solc test.sol --ir
Error: Unimplemented feature
 --> test.sol:5:9:
  |
5 |         assembly {
  |         ^ (Relevant source part starts here and spans across multiple lines).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.low impactChanges are not very noticeable or potential benefits are limited.must have eventuallySomething we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.should compile without errorError is reported even though it shouldn't. Source is fine.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions