microsoft / verisol

A formal verifier and analysis tool for Solidity Smart Contracts
Other
245 stars 46 forks source link

Struct constructor not recognized in invocation #87

Closed garbervetsky closed 5 years ago

garbervetsky commented 5 years ago

Related with #76.

When a constructor is called in an invocation it is recognized as a function invocation rather that a call to a constructor.

` pragma solidity ^0.4.24;

contract StructConstructorInvoke { S[] ss; S s; struct S { uint x; uint y; string z; }

function testStructConstructor() public {
    ss.push(S(22, 33, "abc")); // Here is the problem
    s = ss[0];
    assert (s.x == 22);
    assert (s.y == 33);
}

} `

shuvendu-lahiri commented 5 years ago

@garbervetsky try the fix and close the issue.

garbervetsky commented 5 years ago

@shuvendu-lahiri I tried the fix and it works well.