everx-labs / TVM-Solidity-Compiler

Solidity compiler for TVM
GNU General Public License v3.0
125 stars 72 forks source link

contract constructor can't be external #98

Closed cryshado closed 1 year ago

cryshado commented 2 years ago

When I try to compile the following code:

pragma ton-solidity >=0.59.4;

contract Test {
    constructor() external internalMsg { }
}   

I get an error: Error: Constructor must be public or internal. I want to allow deploy my smart contract by internal message without making the constructor call available inside the contract, but I can't do that. I think this seems to be an issue.

webala commented 2 years ago

The constructor cannot be explicitly "called" from within the contract hence no need for external modifier. Furthermore, external keyword on constructors causes issues with inheritance.