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

Possible simplification for list return type checking #1691

Closed
smarx opened this issue Nov 9, 2019 · 0 comments · Fixed by #1797
Closed

Possible simplification for list return type checking #1691

smarx opened this issue Nov 9, 2019 · 0 comments · Fixed by #1797

Comments

@smarx
Copy link
Contributor

smarx commented Nov 9, 2019

It seems that the following check:

https://github.com/ethereum/vyper/blob/c296b2d7532d913103aad494b749f8179a3acddc/vyper/parser/stmt.py#L869-L877

can simply be:

if sub.typ.subtype != self.context.return_type.subtype:
    raise TypeMismatchException(
        f"List return type {sub.typ.subtype} does not match specified "
        f"return type, expecting {self.context.return_type.subtype}",
        self.stmt
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants