fix #3159, constructing type with Ptr member