Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline candid definitions aren't recognized #63

Open
bodily11 opened this issue May 25, 2022 · 3 comments
Open

Inline candid definitions aren't recognized #63

bodily11 opened this issue May 25, 2022 · 3 comments

Comments

@bodily11
Copy link

I have noticed that your candid parser doesn't parse types/values in candid if they are defined inline. So I have had to pull candid files and manually edit (pull out all inline definitions to define them normally) because they aren't pick up by the candid parser.

This is an enhancement that would be awesome to see.

@Myse1f
Copy link
Contributor

Myse1f commented May 31, 2022

What do you mean 'defined inline'? Any examples?

@SuddenlyHazel
Copy link

I'm hitting this issue now too. I think what @bodily11 was referring to is the following. Take for instance

type Balances = vec record {
    0: text;
    1: nat64;
};

The parser won't accept it unless you break out the nested record like so

type BalanceTuple = record {
    0: text;
    1: nat64;
};

type Balances = vec BalanceTuple;

@SuddenlyHazel
Copy link

Actually, I think nested definitions might be okay. But, the numbered tuple format isn't


// Doesn't work
type BalanceTuple = record {
    0: text;
    1: nat64;
};

// Works 
type BalanceTuple = record {
    text;
    nat64;
};

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

No branches or pull requests

3 participants