Skip to content

Commit 7fbf134

Browse files
committed
Add test for fixed natspec ICE
1 parent a07b3ec commit 7fbf134

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
@@ -2534,6 +2534,55 @@ BOOST_AUTO_TEST_CASE(dev_struct_getter_override)
25342534
checkNatspec(sourceCode, "Thing", natspec2, false);
25352535
}
25362536

2537+
BOOST_AUTO_TEST_CASE(dev_struct_getter_override_no_return_name)
2538+
{
2539+
char const *sourceCode = R"(
2540+
interface IThing {
2541+
///@return
2542+
function value(uint) external returns (uint128,uint128);
2543+
}
2544+
2545+
contract Thing is IThing {
2546+
struct Value {
2547+
uint128 x;
2548+
uint128 A;
2549+
}
2550+
mapping(uint=>Value) public override value;
2551+
}
2552+
)";
2553+
2554+
char const *natspec = R"ABCDEF({
2555+
"methods":
2556+
{
2557+
"value(uint256)":
2558+
{
2559+
"returns":
2560+
{
2561+
"_0": ""
2562+
}
2563+
}
2564+
}
2565+
})ABCDEF";
2566+
2567+
char const *natspec2 = R"ABCDEF({
2568+
"methods": {},
2569+
"stateVariables":
2570+
{
2571+
"value":
2572+
{
2573+
"return": "x ",
2574+
"returns":
2575+
{
2576+
"x": ""
2577+
}
2578+
}
2579+
}
2580+
})ABCDEF";
2581+
2582+
checkNatspec(sourceCode, "IThing", natspec, false);
2583+
checkNatspec(sourceCode, "Thing", natspec2, false);
2584+
}
2585+
25372586
BOOST_AUTO_TEST_CASE(dev_struct_getter_override_different_return_parameter_names)
25382587
{
25392588
char const *sourceCode = R"(

0 commit comments

Comments
 (0)