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

Uncaught exceptions when using maps of tuples #1432

Closed
fubuloubu opened this issue May 10, 2019 · 3 comments
Closed

Uncaught exceptions when using maps of tuples #1432

fubuloubu opened this issue May 10, 2019 · 3 comments
Labels
bug Bug that shouldn't change language semantics when fixed. Easy Pickings Used to denote issues that should be easy to implement

Comments

@fubuloubu
Copy link
Member

Version Information

  • vyper Version (output of vyper --version): 0.1.0b9
  • OS: linux
  • Python Version (output of python --version): Python 3.6.6
  • Environment (output of pip freeze):
flake8==3.5.0
mccabe==0.6.1
pycodestyle==2.3.1
pycryptodome==3.6.6
pyflakes==1.6.0

What's your issue about?

I got some uncaught exceptions when trying to work with maps of tuples:

foo: map(uint256, (uint256, uint256))  # Works fine by itself
@public
def bar1(_t: uint256):
    assert self.foo[_t] == (0, 0)
    # AttributeError: 'TupleType' object has no attribute 'unit'
@public
def bar2(_t: uint256):
    self.foo[_t] = (1, 1)
    # UnboundLocalError: local variable 'subtype' referenced before assignment
@public
@constant
def baz(_t: uint256) -> (uint256, uint256):
    return self.foo[_t]
    # UnboundLocalError: local variable 'subtype' referenced before assignment

How can it be fixed?

Could be related to #1431.

@jacqueswww
Copy link
Contributor

Same as in #1431 we don't support tuples as data types. And I don't think we should.

@fubuloubu
Copy link
Member Author

Resolution is the same as it is in #1431 then: make it clearer that Tuples are not supported up front.

@fubuloubu fubuloubu added bug Bug that shouldn't change language semantics when fixed. Easy Pickings Used to denote issues that should be easy to implement labels Jan 24, 2020
@iamdefinitelyahuman
Copy link
Contributor

Fixed by #2029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that shouldn't change language semantics when fixed. Easy Pickings Used to denote issues that should be easy to implement
Projects
None yet
Development

No branches or pull requests

3 participants