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

transfer() with specified amount in init() #472

Open
wmanshu opened this issue Aug 23, 2019 · 1 comment
Open

transfer() with specified amount in init() #472

wmanshu opened this issue Aug 23, 2019 · 1 comment

Comments

@wmanshu
Copy link

wmanshu commented Aug 23, 2019

 @payable
  public init(implicit _value : inout Wei)
  mutates (Wei.rawValue)
  {
    ...
    let amountToTransfer: Int = _value.rawValue
    self.value = Wei(0)
    value.transfer(source: &_value, amount: amountToTransfer)
    ...
  }

This gives an error in EVM IR Preprocessor: received unexpected type 'errorType'
I also tried using exactly same lines in a normal function, it works fine.

The other case, transfer(source: &_value) works fine in init().

@wmanshu
Copy link
Author

wmanshu commented Aug 23, 2019

Also happens to Wei(source: &_value, amount: amountToTransfer)

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

1 participant