# Struct initialization errors unexpectactly

**URL:** <https://forum.fuel.network/t/struct-initialization-errors-unexpectactly/2410>\
**Category:** Sway\
**Created:** [April 19, 2023, 5:20pm UTC](https://forum.fuel.network/t/struct-initialization-errors-unexpectactly/2410 "2023-04-19T17:20:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maurice](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@maurice](https://forum.fuel.network/u/maurice)\
**Post date:** [April 19, 2023, 5:20pm UTC](https://forum.fuel.network/t/struct-initialization-errors-unexpectactly/2410/1 "2023-04-19T17:20:42Z")

</div>

Hi guys, easy reproducer follows. Running everything on latest.  
Uncomment the second struct initialization to get the error. First one works, as soon as second is added, it errors.

```plaintext
contract;

abi MyContract {
    fn test_function() -> bool;
}

struct Foo {
    a: u64,
    b: u64,
    c: u64,
    d: u64,
    e: u64,
    f: u64,
}

impl Foo {
    fn new(
        a: u64,
        b: u64,
        c: u64,
        d: u64,
        e: u64,
        f: u64,
    ) -> Self {
        Self {
            a,
            b,
            c,
            d,
            e,
            f,
        }
    }
}

impl MyContract for Contract {
    fn test_function() -> bool {
        let bar1 = Foo::new(0,0,0,0,0,0);
        // let bar2 = Foo::new(0,0,0,0,0,0);
        true
    }
}

```

The error you will see:

```auto
thread 'main' panicked at 'not yet implemented: can't do more than 6 args yet', sway-core/src/asm_generation/fuel/functions.rs:74:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

```

As always, thanks for any help.

---

<div class="post-metadata">

**Author:** ![mohammadfawaz](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@mohammadfawaz](https://forum.fuel.network/u/mohammadfawaz)\
**Post date:** [April 20, 2023, 3:42pm UTC](https://forum.fuel.network/t/struct-initialization-errors-unexpectactly/2410/2 "2023-04-20T15:42:51Z")

</div>

We will take a look at this asap! Certainly a bug. Filed here: [Compiler panics with "can't do more than 6 args yet" · Issue #4477 · FuelLabs/sway · GitHub](https://github.com/FuelLabs/sway/issues/4477)

---

<div class="post-metadata">

**Author:** ![maurice](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@maurice](https://forum.fuel.network/u/maurice)\
**Post date:** [April 20, 2023, 4:21pm UTC](https://forum.fuel.network/t/struct-initialization-errors-unexpectactly/2410/3 "2023-04-20T16:21:18Z")

</div>

Thanks a lot Mohammad 🙂
