# Recent Parameter Deduction is not Working

**URL:** <https://forum.modular.com/t/recent-parameter-deduction-is-not-working/1970>\
**Category:** Mojo\
**Tags:** mojo-compiler\
**Created:** [July 16, 2025, 9:55pm UTC](https://forum.modular.com/t/recent-parameter-deduction-is-not-working/1970 "2025-07-16T21:55:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@Samuel](https://forum.modular.com/u/Samuel)\
**Post date:** [July 16, 2025, 9:55pm UTC](https://forum.modular.com/t/recent-parameter-deduction-is-not-working/1970/1 "2025-07-16T21:55:05Z")

</div>

Something has changed on the Parameter world. Previously, Traits with aliases work perfect. I used to combine it with structs to get really good dynamism, but now, somehow the compiler is failing when it needs to use trait aliases in certain places. Example:

```mojo
trait WithAnAlias:
    alias A: AnyType

# Struct that conforms to `WithAnAlias`
struct SomeStruct(WithAnAlias):
    alias A = Int

# Needs a struct that conforms to `WithAnAlias`
# Will assing a and b automatically
struct SomeWrapper[t: WithAnAlias, a: AnyType, b: AnyType]:
    fn __init__ (out self: SomeWrapper[t, t.A, t.A]):
        pass

fn main():
    _sw = SomeWrapper[SomeStruct]()
    # invalid initialization: could not deduce parameter 'b' of parent struct 'SomeWrapper'

```

I recently noticed some function called `get_witness` that I didn’t see in the past. I’m not sure if it’s related to it, but now this code is not working. If we use only 1 parameter, it works.

```mojo
struct SomeWrapper[t: WithAnAlias, a: AnyType]:
    fn __init__ (out self: SomeWrapper[t, t.A]):
        pass

fn main():
    _sw = SomeWrapper[SomeStruct]()

```

All good now. But why in the first case it didn’t work?

Related issue: [https://github.com/modular/modular/issues/5016](https://github.com/modular/modular/issues/5016)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [January 12, 2026, 9:55pm UTC](https://forum.modular.com/t/recent-parameter-deduction-is-not-working/1970/2 "2026-01-12T21:55:18Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
