Skip to content

Commit e3e77c0

Browse files
author
Leo
authored
Merge pull request #12551 from ethereum/natspec-test
Add test for fixed natspec ICE
2 parents 3915768 + 7fbf134 commit e3e77c0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

test/libsolidity/SolidityNatspecJSON.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,55 @@ BOOST_AUTO_TEST_CASE(dev_struct_getter_override)
25822582
checkNatspec(sourceCode, "Thing", natspec2, false);
25832583
}
25842584

2585+
BOOST_AUTO_TEST_CASE(dev_struct_getter_override_no_return_name)
2586+
{
2587+
char const *sourceCode = R"(
2588+
interface IThing {
2589+
///@return
2590+
function value(uint) external returns (uint128,uint128);
2591+
}
2592+
2593+
contract Thing is IThing {
2594+
struct Value {
2595+
uint128 x;
2596+
uint128 A;
2597+
}
2598+
mapping(uint=>Value) public override value;
2599+
}
2600+
)";
2601+
2602+
char const *natspec = R"ABCDEF({
2603+
"methods":
2604+
{
2605+
"value(uint256)":
2606+
{
2607+
"returns":
2608+
{
2609+
"_0": ""
2610+
}
2611+
}
2612+
}
2613+
})ABCDEF";
2614+
2615+
char const *natspec2 = R"ABCDEF({
2616+
"methods": {},
2617+
"stateVariables":
2618+
{
2619+
"value":
2620+
{
2621+
"return": "x ",
2622+
"returns":
2623+
{
2624+
"x": ""
2625+
}
2626+
}
2627+
}
2628+
})ABCDEF";
2629+
2630+
checkNatspec(sourceCode, "IThing", natspec, false);
2631+
checkNatspec(sourceCode, "Thing", natspec2, false);
2632+
}
2633+
25852634
BOOST_AUTO_TEST_CASE(dev_struct_getter_override_different_return_parameter_names)
25862635
{
25872636
char const *sourceCode = R"(

0 commit comments

Comments
 (0)