Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

ask does not print debug info precisely #52

Open
Astrapolis-peasant opened this issue Jan 17, 2022 · 0 comments
Open

ask does not print debug info precisely #52

Astrapolis-peasant opened this issue Jan 17, 2022 · 0 comments

Comments

@Astrapolis-peasant
Copy link

having this example code
···
import { PackedStorableArray} from "ask-lang";

@contract
class Flipper {
@State flag: bool;

@state
@packed({ "capacity": 128 })
packeArr: PackedStorableArray<UInt128> = new PackedStorableArray<UInt128>();

@state
aArr: PackedStorableArray<UInt128> = new PackedStorableArray<UInt128>();

constructor() {
}

@constructor
default(initFlag: bool): void {
    this.flag = initFlag;
}

@message
flip(): void {
    const v = this.flag;
    this.flag = !v;
}

@message({"mutates": false})
get(): bool {
    return this.flag;
}

}
···
Since we do not import UInt128, this code will not compile.

However, in debug

FAILURE TypeError: Cannot read property 'kind' of null
    at NamedTypeNodeDef.getTypeKind (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/typedef.js:206:21)
    at new NamedTypeNodeDef (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/typedef.js:58:32)
    at FieldDef.resolveField (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/elementdef.js:92:25)
    at new FieldDef (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/elementdef.js:82:15)
    at /home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/classdef.js:52:39
    at Map.forEach (<anonymous>)
    at ContractInterpreter.ClassInterpreter.resolveFieldMembers (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/classdef.js:50:42)
    at ContractInterpreter.ClassInterpreter [as constructor] (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/classdef.js:44:15)
    at new ContractInterpreter (/home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/classdef.js:87:28)
    at /home/bonan/repos/ask/ask-cli-test/node_modules/ask-transform/dist/contract/contract.js:44:28

I think this is caused by 2 step transform as the way of compilation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant