rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Typechecker reports used variable as unused

Open toinehartman opened this issue 1 year ago • 0 comments

Describe the bug

The typechecker reports a 'unused pattern variable' warning on a used pattern variable

To Reproduce Unfortunately, I have not been able to reproduce this in a smaller example.

data D
  = a(str s, D d)
  | b()
  ;

void f() {
  set[D] ds1 = {};
  set[D] ds2 = {d
    | D d: a(_, child: b()) <- ds1
    , s2: "bar" := "foo" // Warning: "Unused patternvariable `s2`"
    , /s2 := child
  };
}

Expected behavior No unused warning on s2.

toinehartman avatar Aug 07 '24 12:08 toinehartman