{"record":{"id":"b40e7979043a1f91","repo":"mono/mono","slug":"s-w-line-d-of-s-d-s-is-untyped","errorCode":null,"errorMessage":"%s: w - line %d of \"%s\", $%d (%s) is untyped\n","messagePattern":"(.+?): w - line (.+?) of \"(.+?)\", \\$(.+?) \\((.+?)\\) is untyped\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mcs/jay/error.c","lineNumber":264,"sourceCode":"{\n    fprintf(stderr, \"%s: e - line %d of \\\"%s\\\", illegal $-name\\n\",\n\t    myname, a_lineno, input_file_name);\n    print_pos(a_line, a_cptr);\n    done(1);\n}\n\nvoid\nuntyped_lhs (void)\n{\n    fprintf(stderr, \"%s: w - line %d of \\\"%s\\\", $$ is untyped\\n\",\n\t    myname, lineno, input_file_name);\n    /** done(1); */\n}\n\nvoid\nuntyped_rhs (int i,  const char *s)\n{\n    fprintf(stderr, \"%s: w - line %d of \\\"%s\\\", $%d (%s) is untyped\\n\",\n\t    myname, lineno, input_file_name, i, s);\n    /** done(1); */\n}\n\nvoid\nunknown_rhs (int i)\n{\n    fprintf(stderr, \"%s: e - line %d of \\\"%s\\\", $%d is untyped\\n\",\n\t    myname, lineno, input_file_name, i);\n    done(1);\n}\n\nvoid\ndefault_action_warning (void)\n{\n    fprintf(stderr, \"%s: w - line %d of \\\"%s\\\", the default action assigns an \\\nundefined value to $$\\n\", myname, lineno, input_file_name);\n}","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/mono/mono/blob/0f53e9e151d92944cacab3e24ac359410c606df6/mcs/jay/error.c#L246-L282","documentation":"Emitted by untyped_rhs() in mcs/jay/error.c:264, reached from copy_action() (reader.c:1146) when a positional `$N` references an RHS symbol that has no declared tag while tags are in use elsewhere (ntags>0). It is a warning (done() commented out); jay still emits the untyped yyVals reference, risking a runtime cast/boxing issue.","triggerScenarios":"Referencing `$2` where the second RHS symbol lacks a `%type`/`%token <Tag>` declaration in a grammar that otherwise uses typed values.","commonSituations":"Adding a symbol to a production and using it via `$N` before declaring its type; referencing a literal token (which has no value) positionally.","solutions":["Declare the symbol's type, e.g. `%type <Tag> name` or `%token <Tag> name`.","If the referenced symbol is a valueless literal token, do not read `$N` for it; renumber subsequent references.","Audit all `%type`/`%token <Tag>` declarations against the symbols you dereference."],"exampleFix":"// before\n%type <int> num\n%%\nexpr : num op num { $$ = $1 + $3; }  /* op untyped -> untyped_rhs(2,op) */\n// after\n%type <int> num\n%token op   /* op carries no value; reference $1/$3 only, not $2 */","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare %type/%token <Tag> for every symbol you dereference via `$N`.","Do not read `$N` for positions occupied by valueless literal tokens.","Cross-check the declaration list against all `$N` references."],"tags":["jay","grammar","action","types","dollar-reference"],"backgroundTag":null,"analyzedSha":"0f53e9e151d92944cacab3e24ac359410c606df6","analyzedAt":"2026-08-13T18:54:37.190Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}