compile: better types checks on virtual type