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

Error: Unknown field countLegs on MemberAccess #8048 of type TokenId. #262

Open
ezcodeslide opened this issue Apr 12, 2024 · 3 comments
Open
Assignees

Comments

@ezcodeslide
Copy link

I ran into an issue using InferType.isFunctionCallExternal(). Not sure if I'm doing something wrong but wanted to reach out for an assessment/recommendation. I'm using solc-typed-ast 18.1.3.

Calling code:

// solcVersion === '0.8.25'
const inferType: InferType = new InferType(solcVersion);
// call is an instance of FunctionCall
return inferType.isFunctionCallExternal(call);

Error info:

Error: Unknown field countLegs on MemberAccess #8048 of type TokenId.

MemberAccess #8048
    id: 8048
    src: "31693:20:2"
    typeString: "function (TokenId) pure returns (uint256)"
    vExpression: Identifier #8047
    memberName: "countLegs"
    referencedDeclaration: 24438
    context: ASTContext #20
    parent: FunctionCall #8049
    <getter> children: Array(1) [ Identifier #8047 ]
    <getter> vReferencedDeclaration: FunctionDefinition #24438
    <getter> type: "MemberAccess"
    <getter> firstChild: Identifier #8047
    <getter> lastChild: Identifier #8047
    <getter> previousSibling: undefined
    <getter> nextSibling: undefined
    <getter> root: SourceUnit #9892
    <getter> sourceInfo: Object { offset: 31693, length: 20, sourceIndex: 2 }

    at assert (/home/user/project/node_modules/solc-typed-ast/src/misc/utils.ts:32:11)
    at InferType.typeOfMemberAccess (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:1303:15)
    at InferType.typeOf (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:1773:25)
    at InferType.isFunctionCallExternal (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:2719:26)
@ezcodeslide
Copy link
Author

I updated to solc-typed-ast 18.1.6. Now I get a different error.

SolTypeError: Unexpected argument type literal_hex_string to builtin function bytes.concat in FunctionCall #3519.
    at InferType.typeOfMemberAccessImpl (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:1440:39)
    at InferType.typeOfMemberAccess (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:1281:30)
    at InferType.typeOf (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:1778:25)
    at InferType.isFunctionCallExternal (/home/user/project/node_modules/solc-typed-ast/src/types/infer.ts:2724:26)
    at isFunctionCallExternal (/home/user/project/src/utils.ts:1413:20)

@cd1m0 cd1m0 self-assigned this Jul 11, 2024
@cd1m0
Copy link
Contributor

cd1m0 commented Jul 11, 2024

Looking into this

@cd1m0
Copy link
Contributor

cd1m0 commented Jul 17, 2024

Do you have a code sample you could provide to reproduce locally?

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

2 participants