Skip to content

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

@wmanshu

Description

@wmanshu
 @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().

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