Added a test related to #516
Close #526

The cause of the error was in incorrect constant propagation.

Due to differences in the hdling of list and set patterns it was only
triggered in the list case.

For now, constant propagation is turned off for these cases, but this
should be solved more fundamentally.