Support type alias

Fix #672.
I think #if DEBUG is meaningless since `debug` already works in debug config only. Such extensive output can make overall performance very poor.