add method to typebuilder to indicate the compile is ok, and modify main sample code