tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
280 stars 56 forks source link

An implicit method declaration `.toCell()` causes problems with method resolution for structures in IDE #293

Open andreypfau opened 2 months ago

andreypfau commented 2 months ago

At the moment, structures have an implicit method .toCell() which cannot be resolved in the IDE

image

Posible solution: Add trait like BaseTrait, but for structures with declaration of toCell() method

novusnota commented 2 months ago

Well, some of the methods are declared not in Tact, but in TypeScript. For example, map<K, V> type also has a couple of methods declared here: map.ts. And here are some of the global functions: global.ts.

So it's probably easiest to resolve the types as you do and then manually populate them with such methods. Or just to have a lookup table for those.

I don't think that we're going to move all functions into .tact sources, so it's up to tools (or new APIs?) to keep track of what's there beyond the stdlib of .fc and .tact. @anton-trunov may correct me here