rascal icon indicating copy to clipboard operation
rascal copied to clipboard

False positive message: undeclared data-type in left-hand side of no-match

Open jurgenvinju opened this issue 4 years ago • 0 comments
trafficstars

Describe the bug

[ERROR] salix/Core.rsc:195:13: Undefined Attr

is about this code in salix:

if (vals != []) { 
    if (void() block := vals[-1]) { 
      block();
    }
    else if (Node h := vals[-1]) { 
      add(h);
    }
    else if (Attr _ !:= vals[-1]) { // ERROR iS REPORTED HERE
      _text(vals[-1]);
    }
  }

But Attr is used elsewhere in the module and there are no complaints. The code also runs correctly in the interpreter.

I'll try and make a small test case for this bug later

To Reproduce

  • clone the salix project: https://github.com/cwi-swat/salix
  • run mvn compile
  • or edit src/salix/Core.rsc in an IDE that supports the Rascal type-checker

jurgenvinju avatar Jun 16 '21 09:06 jurgenvinju