icerpc / slicec

The Slice compiler library
Apache License 2.0
13 stars 5 forks source link

Compiler Panics on Some Slice files without Module Declarations #666

Closed InsertCreativityHere closed 10 months ago

InsertCreativityHere commented 10 months ago

The logic used by the slice parser to push and pop scopes assumes there is a module scope present in some cases (anything with 2 levels of nesting like operations or the new enumerator with associated fields).

If you forget to add a module declaration in files containing these things, the compiler will panic instead of correctly emitting a "syntax error: module declaration is required".

InsertCreativityHere commented 10 months ago

This was fixed by https://github.com/icerpc/slicec/commit/b4439949342b32ce0de1e14b128037a36017c8e6.