Skip to content

Missing parentheses in cast #1

@Kripth

Description

@Kripth

When decompiling a cast it seems that the outer parentheses are optimised away.

Example:

fun test(a: u64): u256 {
    (a as u256)
}

// decompiles to
fun test(arg0: u64) : u256 {
    arg0 as u256
}

When a cast is not the outer operator it is decompiled correctly:

fun test(a: u64): u256 {
    ((a as u128) as u256)
}

// decompiles to
fun test(arg0: u64) : u256 {
    (arg0 as u128) as u256
}

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