Typechecker goes nuts
Something really weird is happening when typechecking the following trivial program:
int id (int x) { return x; }
int main () { return id ((1, (1, 1))); }
sac2c
dies at:
** 6: Running type inference system ...
**** Enforcing Specializations ...
**** Running type inference system ...
OOOOOOOPS, your program crashed the compiler 8-((
Backtrace suggests that:
0x00007ffff7af9325 in TYisProd (type=0x0)
at /tmp/sac2c/src/libsac2c/typecheck/new_types.c:3480
3480 DBUG_RETURN (NTYPE_CON (type) == TC_prod);
(gdb) backtrace
#0 0x00007ffff7af9325 in TYisProd (type=0x0)
at /tmp/sac2c/src/libsac2c/typecheck/new_types.c:3480
#1 0x00007ffff7afafc4 in TYeliminateAlpha (t1=0x0)
at /tmp/sac2c/src/libsac2c/typecheck/new_types.c:4153
Could it be that (1, (1, 1)) is treated as a tuple by some reason?