tact icon indicating copy to clipboard operation
tact copied to clipboard

Unexpected import dependency error

Open 0kenx opened this issue 1 year ago • 0 comments

Example

File A.tact:

import "./B.tact";
import "./C.tact";

contract A with B {}

File B.tact

message(0x5555AAAA) M {}
trait B {}

File C.tact

message(0x5555AAAA) M {}

Gives Error: B.tact: Type M already exists.

My expectation

When I import B.tact with the intention of using trait B, I do not expect all messages (mostly implementation details of B) to also be imported into the scope of A.

Workaround

Currently it's possible to circumvent this by coding B with all messages prefixed with B__ to minimize the possibility of clashes.

Ideal solution: limited import scope

Ideally, Tact should introduce syntax import B from "./B.tact" to solve this issue.

0kenx avatar Jan 30 '24 01:01 0kenx