uuosio / ascdk

MIT License
12 stars 9 forks source link

Enhance type-checking #10

Closed jafri closed 2 years ago

jafri commented 2 years ago

Currently a few type-checking errors pop up:

Cannot find name 'contract'.ts(2304)

This could be fixed by exporting stub functions for decorators like:

function contract(_: string): any {}
function action(_: string): any {}
function table(_: string): any {}

Another type-checking error that pops up while developing is:

Type 'AccountsTable' does not satisfy the constraint 'MultiIndexValue'.ts(2344)

This is because the rest of the fields are only added as part of the extension after processing, perhaps the other fields for MultiIndexValue should become optional

learnforpractice commented 2 years ago

Yes, you are right. Help me fix it if you can.

On Feb 20, 2022, at 2:54 PM, Syed Jafri @.***> wrote:

Currently a few type-checking errors pop up:

Cannot find name 'contract'.ts(2304) This could be fixed by exporting stub functions for decorators like:

function contract(: string): any {} function action(: string): any {} function table(_: string): any {} Another type-checking error that pops up while developing is:

Type 'AccountsTable' does not satisfy the constraint 'MultiIndexValue'.ts(2344) This is because the rest of the fields are only added as part of the extension after processing, perhaps the other fields for MultiIndexValue should become optional

— Reply to this email directly, view it on GitHub https://github.com/uuosio/ascdk/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPJSPT7ZEL2CQOS64SAGR3U4CF4FANCNFSM5O4AQVAQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.

jafri commented 2 years ago

@learnforpractice do you know how to make Cannot find name 'u64' type errors go away while developing for AS?

learnforpractice commented 2 years ago

Nope.

On Feb 20, 2022, at 3:32 PM, Syed Jafri @.***> wrote:

@learnforpractice https://github.com/learnforpractice do you know how to make Cannot find name 'u64' type errors go away while developing for AS?

— Reply to this email directly, view it on GitHub https://github.com/uuosio/ascdk/issues/10#issuecomment-1046180343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPJSPWQZV4CB3I5SDQARY3U4CKJFANCNFSM5O4AQVAQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.

learnforpractice commented 2 years ago

I found an AssemblyScript plugin for VSCode:

https://marketplace.visualstudio.com/items?itemName=saulecabrera.asls

learnforpractice commented 2 years ago

I found an AssemblyScript plugin for VSCode:

https://marketplace.visualstudio.com/items?itemName=saulecabrera.asls

This plugin is not working on Mac OSX platform due to the following issue:

https://github.com/Shopify/vscode-as/issues/20

jafri commented 2 years ago

@learnforpractice is this right?

Screen Shot 2022-02-20 at 10 20 16 AM
jafri commented 2 years ago

The main type issues at the moment are MultiIndexValue, Packer, and .new (on MultiIndexValue through Tpl)

learnforpractice commented 2 years ago

Should be fixed by 4813106a913009757bf72993c899d9340f08fe5a