Added test for #1549
Fixed #1549 member class refinement and contravariant types