rewrite getLeafValue()