zeek / spicy

C++ parser generator for dissecting protocols & files.
https://docs.zeek.org/projects/spicy
Other
243 stars 37 forks source link

Enforce that the argument `new` is either a type or a ctor. #1756

Closed rsmmr closed 2 months ago

rsmmr commented 2 months ago

So far we allowed some more generic expressions as well, but it's hard for the parser to support arbitrary expressions here due to parsing ambiguities, leaving things inconsistent. So we now limit it to what was pretty much the intent originally anyways.

Note that the error message for #1598 stays the same: it's not great, but seems good enough. However, we now actually disallow the workaround shown in the ticket as well for consistency. The new work-around is shown in the changes to hilti.codegen.type-info.

Closes #1598.