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

Scribble type-checking should support generic public getters #141

Closed
cd1m0 opened this issue Feb 2, 2022 · 0 comments · Fixed by #142
Closed

Scribble type-checking should support generic public getters #141

cd1m0 opened this issue Feb 2, 2022 · 0 comments · Fixed by #142
Assignees

Comments

@cd1m0
Copy link
Collaborator

cd1m0 commented Feb 2, 2022

In tcFunCall in typecheck.ts we have the following code that is meant to handle function calls to public getters:

        } else {
            if (def.vType instanceof UserDefinedTypeName) {
                throw new Error(`NYI public getters for ${def.vType.print()}`);
            }

            // def.vType is defined, as you can't put a `var x,` in a contract state var definition.
            return astVarToTypeNode(def);
        }

The reason behind the check for a UserDefinedTypeName was that public getters for state vars that are structs return an array with some of the fields of the struct in solidity. Since we didn't want to model this at the time we decided to just not handle these cases.

However now we have code that computes the function type for public getters in solc-typed-ast. So we should fix this to support arbitrary public getters.

@cd1m0 cd1m0 self-assigned this Feb 2, 2022
cd1m0 added a commit that referenced this issue Feb 2, 2022
@cd1m0 cd1m0 mentioned this issue Feb 2, 2022
@cd1m0 cd1m0 closed this as completed in #142 Feb 3, 2022
cd1m0 added a commit that referenced this issue Feb 3, 2022
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

Successfully merging a pull request may close this issue.

1 participant