hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.23k stars 224 forks source link

to_cpp1: Remove missing initializer assert #1124

Closed sookach closed 1 week ago

sookach commented 2 weeks ago

Patches #1123

The program is ill formed, and semantic analysis detects the issue, but because errors are checked after lowering, it hits an assert when spitting out the cpp code, causing the crash. We could, of course, check for errors generated by semantic analysis before lowering, but this pr simply swaps out the assert for a return, so as to maintain the current structure.

hsutter commented 1 week ago

Thanks! I tried to push an alternate solution to this branch but I don't have permission, so I'll apply the solution on main separately instead of taking this PR, and reference this PR. Again, thanks for this.