Should compare classes first to see if it's safe to call type on them BohemianCoding/Sketch#3496