argotorg / argotorg/solidity

ICE for user-defined value type in external library function

Open
#16,225 0 comments 1 reaction 0 assignees View on GitHub
bug :bug:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

## Description

The following code triggers the ICE shown below in the latest solc version ```0.8.30```. The issue appears to have started with version `0.8.8`, which was when user-defined value types were introduced.

## Steps to Reproduce

`testcase.sol`

```solidity
// SPDX-License-Identifier: GPL-3.0

pragma solidity =0.8.30;

type T is bool;

library L {
function f(T[] storage p) external {
}
}
```

`
solc testcase.sol
`

```
Internal compiler error:
/solidity/libsolidity/ast/Types.h(1199): Throw in function virtual std::string solidity::frontend::UserDefinedValueType::signatureInExternalFunction(bool) const
Dynamic exception type: boost::wrapexcept
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed
```

## Environment

- Compiler version: ```0.8.30```

Contributor guide

Open the contributing guide

Research direction

Start with testcase.sol and reproduce the failure using solc 0.8.30. Then inspect the UserDefinedValueType::signatureInExternalFunction assertion reported at Types.h(1199), including how the external library function handles T[] storage. Done means this input no longer triggers an internal compiler error and receives appropriate compiler handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.