Skip to content

bug: mutability of interface functions are not checked in pure functions #3425

@tserg

Description

@tserg

Version Information

  • vyper Version (output of vyper --version): 4f9f813
  • OS: linux
  • Python Version (output of python --version): 3.10.8

What's your issue about?

Mutability of interface functions are not checked in pure functions. This should fail type-checking but it fails at codegen:

interface Foo:
    def foo() -> uint256: payable

@external
@pure
def bar(a: address) -> uint256:
    return Foo(a).foo()
  File "/home/user/vyper/vyper/codegen/external_call.py", line 234, in ir_for_external_call
    _external_call_helper(contract_address, args_ir, call_kwargs, call_expr, context)
  File "/home/user/vyper/vyper/codegen/external_call.py", line 208, in _external_call_helper
    assert use_staticcall, "typechecker missed this"
AssertionError: typechecker missed this

How can it be fixed?

Fill this in if you know how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions