Pass the type of the expression, not of the declaration
Fix #262
tests for #262