Diagnose vector type aliases used as unit fields - #2495
Conversation
We would previously abort with an internal compiler error when a type alias resolving to vector<T> was used as a unit parsing field. This patch updates the validator to diagnose this as an invalid sequence syntax error instead of aborting, matching the diagnostic produced for direct vector<T> field syntax. Closes zeek#2445.
evantypanski
left a comment
There was a problem hiding this comment.
Thanks for the fix
is there a reason this keeps the validation with the same error in parser.yy? I would prefer they both go through the same validation, since they're diagnosing the same thing. Might be worth a bit larger change to get that to work if it doesn't currently.
Remove the duplicate parser-time diagnostic so direct vector fields and type aliases use the same validation path. Refresh the direct-syntax regression to exercise that validator without unrelated obsolete attributes.
|
Good point, thanks. I pushed 5da9852 to remove the parser-time diagnostic, so direct vector fields and aliases now go through the same validator path. I also refreshed the existing direct-syntax regression to remove obsolete |
evantypanski
left a comment
There was a problem hiding this comment.
LGTM, thanks :)
Seems like soon this'll be due for a cleanup, it's been a while since that syntax was supported. This fixes the internal error so I'm happy with this as-is.
We would previously abort with an internal compiler error when a type alias resolving to
vector<T>was used as a unit parsing field.This patch updates the validator to diagnose this as an invalid sequence syntax error instead of aborting, matching the diagnostic produced for direct
vector<T>field syntax.Closes #2445.