Skip to content

lang: const array size not supported in instruction data #1623

@skrrb

Description

@skrrb

the following mwe

use anchor_lang::prelude::*;

declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");

const MAX_SIZE: usize = 5;

#[program]
pub mod tst {
    use super::*;

    pub fn initialize(_ctx: Context<Initialize>, _data: [u8; MAX_SIZE]) -> Result<()> {
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Initialize {}

throws

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', lang/syn/src/idl/mod.rs:202:76                                       
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

related to #968 and #1485

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