xls icon indicating copy to clipboard operation
xls copied to clipboard

DSLX: Missing error check in proc member assignment

Open RobSpringer opened this issue 2 years ago • 0 comments

I have a test proc :

#[test_proc()]
proc Proc {
  terminator: chan<bool> out;
  bar: chan<u32> out;

  config(terminator: chan<bool> out) {
    let (foo, baa) = chan<u32>;

    (terminator, bar)
  }

  next(tok: token) { () }
}

Note that the channel is declared as "baa", but the member assignment is "bar". Instead of a ParseError, we get a Could not find slot or binding for name: bar @ foo.x:5:3-5:6 error. I suspect that the...parser? doesn't catch this error b/c "bar" is considered in scope of config(), but it shouldn't be.

RobSpringer avatar Sep 28 '22 18:09 RobSpringer