Skip to content

lang: two protocols with same name, defined over differents structs #248

Description

@ekiwi

We have some protocols that do the following:

#[idle]
prot idle<DUT: ReadSubordinate>() {
    // ....
}

#[idle]
prot idle<DUT: WriteSubordinate>() {
    // ...
}

This seems like a totally legitimate thing to do. However, it kind of violates some rules around duplicate names that one would expect from a programming language. Namely that you cannot have two functions in the same scope that are both named idle.

Maybe it is time to switch to more of a impl style protocol definition. Like:

impl ReadSubordinate {
  #[idle]
  prot idle(DUT: Self) {
      // ....
  }
}

impl WriteSubordinate{
  #[idle]
  prot idle(DUT: Self) {
      // ....
  }
}

I don't necessarily like the DUT: Self. Another option would be a magic self or even a magic dut.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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