Skip to content

feat: fixed-array use cases #1820

@amkCha

Description

@amkCha

Expand input memory

input data(addr:u16) -> (r:[u8;4])

fn main() {
    if data[0] == data[1] {
       fail
    }
}

In Flatten phase

bitwidth, ok := data.BitWidthOf(vType, env)
			if !ok {

this check will error on [ ] F arrays

Error on syntax reporting

fn f(arr1:[u8;4],arr2:[u8;4], y:u8) -> (r:u8) {
   r = (arr1 == arr2) ? 0 : (128*2)
}
const TWO : u8 = 2

fn f(arr1:[u8;4],arr2:[u8;4], y:u8) -> (r:u8) {
   r = (arr1 == arr2) ? 0 : (y / 128 / TWO)
}

We can avoid PC remapping

fn f(arr:[u4;2]) -> (r:[u4;2]) {
   narr = arr
}

with

fn f(arr:[u4;2]) -> (r:[u4;2]) {
   narr$0, narr$1 = arr$0, arr$1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions