-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE during Natspec generation when emitting an event from a foreign contract or interface #14430
Comments
This is the assert that fails: solAssert(
*eventOrigin == _contractDef ||
(!eventOrigin->isLibrary() && _contractDef.derivesFrom(*eventOrigin)) ||
(eventOrigin->isLibrary() && !_contractDef.derivesFrom(*eventOrigin))
); In my case the event is declared in an interface and used (emited) by a library. Please don't tell me that is not supported ... |
This happends when using WASM and linux-native compilers. |
@Amxx It is not only libraries. I get the same error with even more minimalistic example: // SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
contract X {
event E();
}
contract C {
function g() public {
emit X.E();
}
} Results:
It seems to happen when event is referenced with qualifier. |
Heya, so obviously, the compiler throwing an ICE is generally going to be considered a bug - however, the snippets that both you and @blitz-1306 posted do compile without throwing an ICE. Also, looking at the ICE, it's thrown in Natspec, and I can reproduce it by requesting user docs, i.e. In any case, fix is on the way. edit: same issue is present when requesting |
You claim that compilation works fine but I'm having a hard time making a contract compile (without // SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
contract X {
event E();
}
contract C {
function g() public {
emit X.E();
}
} Now invoking something like Internal compiler error:
C:\Users\circleci\project\libsolidity\interface\Natspec.cpp(89): Throw in function class Json::Value __cdecl solidity::frontend::Natspec::userDocumentation(const class solidity::frontend::ContractDefinition &)
Dynamic exception type: struct boost::wrapexcept<struct solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[struct solidity::util::tag_comment * __ptr64] = Solidity assertion failed Can you elaborate on what am doing wrong? The version I used is the Windows one |
Cross-posting the answer by @nikola-matic here for clarity:
|
comments comments fix fix comments comments comments test test comment ethereum/solidity#14430 comments test comments liberryfy test asdf add manual test asdf test fix asdf asdf comments comments
I moves the OZ contract repo to 0.8.21 to benefit from the new language features, but I'm getting the following error:
Environment
Steps to Reproduce
Minimal example:
The text was updated successfully, but these errors were encountered: