[class] be more future-proof when generating class definition ast