Incompatible types error detection bug