首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Solidity : Doc @注意语句无效

Solidity : Doc @注意语句无效
EN

Ethereum用户
提问于 2017-04-20 14:09:03
回答 1查看 2.5K关注 0票数 3

我正在尝试编译我的可靠智能契约,但我一直收到这样的错误:Doc tag @notice not valid for statements

我的代码中没有@notice语句。这个错误似乎发生在稳定版本从0.4到0.4.9之间,不管有没有优化。

编辑:通过“分而治之”,我可以将错误归因于以下函数:

代码语言:javascript
复制
function f(uint blockNumber, bool finalBlock) returns (bool) {
    if (msg.sender != protocolParameters.A)
        return false; // caller is not Alice

    if (blockNumber > protocolValues.blockNumber && blockNumber <= protocolParameters.numberOfBlocks*2) {
        protocolValues.stageNumber = blockNumber*2;

    } else {
        throw; // TODO: is throw angemessen here?
    }
    /// TODO: careful 
    if (finalBlock) {
        protocolValues.phaseNumber = 2; // we go to the TERMINAL phase
        setPayoffs(protocolParameters.DA, protocolParameters.DB + protocolParameters.FV);
    }

    return true;
}

有什么想法吗?

EN

回答 1

Ethereum用户

回答已采纳

发布于 2017-04-20 14:48:46

问题如下:

代码语言:javascript
复制
/// TODO: careful 

显然,///是由稳健编译器特别处理,并导致错误。

移除它解决了问题。

/** my comment */一起添加的注释也会导致错误。注意注释开头的双星号。

票数 8
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/15357

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档