melt-umn / silver

An attribute grammar-based programming language for composable language extensions
http://melt.cs.umn.edu/silver/
GNU Lesser General Public License v3.0
58 stars 7 forks source link

Invalid tuple selector error hides others #845

Open RandomActsOfGrammar opened 3 months ago

RandomActsOfGrammar commented 3 months ago

If we have

grammar x;

function f
Integer ::=
{
  return x.2;
}

where x is not defined, we get a single error:

Errors for x
 [../x/x.sv]
x.sv:6:9: error: Invalid tuple selector index.

While it is true the index is invalid, I'm more interested in knowing the reason it is invalid is that x is not defined. That error is not showing up.

I'm not really sure how it is possible to get this error, assuming the tests are passing, as there is a test specifically to catch this that was introduced in #505 that was a fix for #503.